Salome HOME
add ompi mpi implementation for cea mars cluster V1_6_0a2
authorsecher <secher>
Wed, 24 Oct 2012 08:37:03 +0000 (08:37 +0000)
committersecher <secher>
Wed, 24 Oct 2012 08:37:03 +0000 (08:37 +0000)
src/Core/Batch_BatchManager_eClient.cxx
src/Core/Batch_MpiImpl.cxx
src/Core/Batch_MpiImpl.hxx

index c9a3951275c0e119251fe81daf69d16f8febf96c..0895672719b7b149487564791be94940851efa99 100644 (file)
@@ -232,6 +232,8 @@ namespace Batch {
       return new MpiImpl_MPICH2();
     else if(mpiImpl == "openmpi")
       return new MpiImpl_OPENMPI();
+    else if(mpiImpl == "ompi")
+      return new MpiImpl_OMPI();
     else if(mpiImpl == "slurm")
       return new MpiImpl_SLURM();
     else if(mpiImpl == "prun")
index 3e93d12ca33d3ed31892b8aa83e415fe6c2d3846..dcd68b0c99e22688a9be7448e66e85db2a229929 100644 (file)
@@ -220,6 +220,49 @@ string MpiImpl_OPENMPI::name()
   return "openmpi";
 }
 
+// ompi implementation
+// Constructor
+MpiImpl_OMPI::MpiImpl_OMPI() : MpiImpl()
+{
+}
+
+// Destructor
+MpiImpl_OMPI::~MpiImpl_OMPI()
+{
+}
+
+string MpiImpl_OMPI::size()
+{
+  return "${OMPI_MCA_ns_nds_num_procs}";
+}
+
+string MpiImpl_OMPI::rank()
+{
+  return "${OMPI_MCA_ns_nds_vpid}";
+}
+
+string MpiImpl_OMPI::boot(const string machinefile, const unsigned int nbnodes)
+{
+  return "";
+}
+
+string MpiImpl_OMPI::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+{
+  ostringstream oss;
+  oss << "mpirun -hostfile " << machinefile << " -np " << nbproc << " " << fileNameToExecute << endl;
+  return oss.str();
+}
+
+string MpiImpl_OMPI::halt()
+{
+  return "";
+}
+
+string MpiImpl_OMPI::name()
+{
+  return "ompi";
+}
+
 // slurm implementation
 // Constructor
 MpiImpl_SLURM::MpiImpl_SLURM() : MpiImpl()
index 12164eec42d2b6b59f55ee8cc9aadd4f05299911..9bc323ff1e2ab8ae12a2c80b47b1e7f1295c4f58 100644 (file)
@@ -134,6 +134,26 @@ private:
 
 };
 
+class BATCH_EXPORT MpiImpl_OMPI : public MpiImpl
+{
+public:
+  // Constructeur et destructeur
+  MpiImpl_OMPI(); // constructor
+  virtual ~MpiImpl_OMPI(); //Destructor
+
+  std::string size(); // get number of process of current job
+  std::string rank(); // get process number of current job
+  std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
+  std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
+  std::string halt(); // get stop command
+  std::string name(); // name of mpi implementation
+
+protected:
+
+private:
+
+};
+
 class BATCH_EXPORT MpiImpl_SLURM : public MpiImpl
 {
 public: