return new MpiImpl_OPENMPI();
else if(mpiImpl == "slurm")
return new MpiImpl_SLURM();
+ else if(mpiImpl == "prun")
+ return new MpiImpl_PRUN();
else if(mpiImpl == "nompi")
throw EmulationException("you must specified an mpi implementation for batch manager");
else{
#include <sstream>
#include <sys/stat.h>
#include "Batch_BatchManager_eSGE.hxx"
+#include <stdlib.h>
+#include <libgen.h>
using namespace std;
string::size_type p1 = fileToExecute.find_last_of("/");
string::size_type p2 = fileToExecute.find_last_of(".");
rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
- fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename(fileToExecute.c_str()));
+ fileNameToExecute = "~/" + dirForTmpFiles + "/" + string(basename((char *) fileToExecute.c_str()));
int idx = dirForTmpFiles.find("Batch/");
filelogtemp = dirForTmpFiles.substr(idx+6, dirForTmpFiles.length());
return "";
}
+// prun implementation
+// Constructor
+MpiImpl_PRUN::MpiImpl_PRUN() : MpiImpl()
+{
+}
+
+// Destructor
+MpiImpl_PRUN::~MpiImpl_PRUN()
+{
+}
+
+string MpiImpl_PRUN::size()
+{
+ return "${RMS_NPROCS}";
+}
+
+string MpiImpl_PRUN::rank()
+{
+ return "${RMS_RANK}";
+}
+
+string MpiImpl_PRUN::boot(const string machinefile, const unsigned int nbnodes)
+{
+ return "";
+}
+
+string MpiImpl_PRUN::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+{
+ ostringstream oss;
+ oss << "prun -n " << nbproc << " " << "-p mpi " << fileNameToExecute << endl;
+ return oss.str();
+}
+
+string MpiImpl_PRUN::halt()
+{
+ return "";
+}
};
+class BATCH_EXPORT MpiImpl_PRUN : public MpiImpl
+{
+public:
+ // Constructeur et destructeur
+ MpiImpl_PRUN(); // constructor
+ virtual ~MpiImpl_PRUN(); //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
+
+protected:
+
+private:
+
+};
+
#endif
// launch container with a system call
int status=system(command.c_str());
- RmTmpFile(); // command file can be removed here
if (status == -1){
MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " <<
"(system command status -1)");
+ RmTmpFile(); // command file can be removed here
return Engines::Container::_nil();
}
else if (status == 217){
MESSAGE("SALOME_LifeCycleCORBA::StartOrFindContainer rsh failed " <<
"(system command status 217)");
+ RmTmpFile(); // command file can be removed here
return Engines::Container::_nil();
}
else{
ret->logfilename(logFilename.c_str());
}
+ RmTmpFile(); // command file can be removed here
return ret;
}
}
case slurm:
mpi = "slurm";
break;
+ case prun:
+ mpi = "prun";
+ break;
case nompi:
throw LauncherException("you must specified an mpi implementation for batch manager");
break;
tempOutputFile << ":$PYTHONPATH" << endl ;
// Test node rank
- tempOutputFile << "if test " ;
+ tempOutputFile << "if test \"" ;
tempOutputFile << mpiImpl->rank() ;
- tempOutputFile << " = 0; then" << endl ;
+ tempOutputFile << "\" = \"0\"; then" << endl ;
// -----------------------------------------------
// Code for rank 0 : launch runAppli and a container
return new MpiImpl_OPENMPI();
case slurm:
return new MpiImpl_SLURM();
+ case prun:
+ return new MpiImpl_PRUN();
case nompi:
throw LauncherException("you must specified an mpi implementation for batch manager");
break;
_resource.mpi = openmpi;
else if (anMpi == "slurm")
_resource.mpi = slurm;
+ else if (anMpi == "prun")
+ _resource.mpi = prun;
else
_resource.mpi = nompi;
}
case slurm:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm");
break;
+ case prun:
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun");
+ break;
default:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "");
}
case slurm:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "slurm");
break;
+ case prun:
+ xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "prun");
+ break;
default:
xmlNewProp(node, BAD_CAST test_mpi, BAD_CAST "");
}
enum BatchType {none, pbs, lsf, sge};
-enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurm};
+enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurm, prun};
class RESOURCESMANAGER_EXPORT ResourceDataToSort
{
p_ptr->mpiImpl = "openmpi";
else if( resource.mpi == slurm )
p_ptr->mpiImpl = "slurm";
+ else if( resource.mpi == prun )
+ p_ptr->mpiImpl = "prun";
if( resource.Batch == pbs )
p_ptr->batch = "pbs";