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")
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()
};
+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: