From: secher Date: Wed, 24 Oct 2012 08:37:03 +0000 (+0000) Subject: add ompi mpi implementation for cea mars cluster X-Git-Tag: V1_6_0a2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ba7d1b2c5630da1ad572cfd307396d2eeb695c7a;p=tools%2Flibbatch.git add ompi mpi implementation for cea mars cluster --- diff --git a/src/Core/Batch_BatchManager_eClient.cxx b/src/Core/Batch_BatchManager_eClient.cxx index c9a3951..0895672 100644 --- a/src/Core/Batch_BatchManager_eClient.cxx +++ b/src/Core/Batch_BatchManager_eClient.cxx @@ -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") diff --git a/src/Core/Batch_MpiImpl.cxx b/src/Core/Batch_MpiImpl.cxx index 3e93d12..dcd68b0 100644 --- a/src/Core/Batch_MpiImpl.cxx +++ b/src/Core/Batch_MpiImpl.cxx @@ -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() diff --git a/src/Core/Batch_MpiImpl.hxx b/src/Core/Batch_MpiImpl.hxx index 12164ee..9bc323f 100644 --- a/src/Core/Batch_MpiImpl.hxx +++ b/src/Core/Batch_MpiImpl.hxx @@ -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: