Salome HOME
changes for eris cluster
authorsecher <secher>
Mon, 22 Oct 2012 12:59:32 +0000 (12:59 +0000)
committersecher <secher>
Mon, 22 Oct 2012 12:59:32 +0000 (12:59 +0000)
src/Core/Batch_MpiImpl.cxx
src/Core/Batch_MpiImpl.hxx
src/SGE/Batch_BatchManager_eSGE.cxx

index f0f5e0774778681a1513e7b99b6c8e96432e9f2a..3e93d12ca33d3ed31892b8aa83e415fe6c2d3846 100644 (file)
@@ -79,6 +79,11 @@ string MpiImpl_LAM::halt()
   return oss.str();
 }
 
+string MpiImpl_LAM::name()
+{
+  return "lam";
+}
+
 // mpich1 implementation
 // Constructor
 MpiImpl_MPICH1::MpiImpl_MPICH1() : MpiImpl()
@@ -117,6 +122,11 @@ string MpiImpl_MPICH1::halt()
   return "";
 }
 
+string MpiImpl_MPICH1::name()
+{
+  return "mpich";
+}
+
 // mpich2 implementation
 // Constructor
 MpiImpl_MPICH2::MpiImpl_MPICH2() : MpiImpl()
@@ -162,6 +172,11 @@ string MpiImpl_MPICH2::halt()
   return oss.str();
 }
 
+string MpiImpl_MPICH2::name()
+{
+  return "mpich";
+}
+
 // openmpi implementation
 // Constructor
 MpiImpl_OPENMPI::MpiImpl_OPENMPI() : MpiImpl()
@@ -200,6 +215,11 @@ string MpiImpl_OPENMPI::halt()
   return "";
 }
 
+string MpiImpl_OPENMPI::name()
+{
+  return "openmpi";
+}
+
 // slurm implementation
 // Constructor
 MpiImpl_SLURM::MpiImpl_SLURM() : MpiImpl()
@@ -238,6 +258,11 @@ string MpiImpl_SLURM::halt()
   return "";
 }
 
+string MpiImpl_SLURM::name()
+{
+  return "slurm";
+}
+
 // prun implementation
 // Constructor
 MpiImpl_PRUN::MpiImpl_PRUN() : MpiImpl()
@@ -275,3 +300,8 @@ string MpiImpl_PRUN::halt()
 {
   return "";
 }
+
+string MpiImpl_PRUN::name()
+{
+  return "prun";
+}
index 6e50dc9e7155c017786a7efa9a795ad3b39090a6..12164eec42d2b6b59f55ee8cc9aadd4f05299911 100644 (file)
@@ -46,6 +46,7 @@ public:
   virtual std::string boot(const std::string machinefile, const unsigned int nbnodes) = 0; // get boot command
   virtual std::string run(const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute) = 0; // get run command
   virtual std::string halt() = 0; // get stop command
+  virtual std::string name() = 0; // name of mpi implementation
 
 protected:
 
@@ -65,6 +66,7 @@ public:
   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:
   
@@ -84,6 +86,7 @@ public:
   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:
   
@@ -103,6 +106,7 @@ public:
   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:
 
@@ -122,6 +126,7 @@ public:
   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:
 
@@ -141,6 +146,7 @@ public:
   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:
 
@@ -160,6 +166,7 @@ public:
   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:
 
index 39a58ccab6bc4488fefa83ad62fafdd115410f74..f6489a437495a4d510a0dfab7c06393271f2e663 100644 (file)
@@ -90,7 +90,7 @@ namespace Batch {
     string logFile = generateTemporaryFileName("SGE-submitlog");
 
     // define command to submit batch
-    string subCommand = string("cd ") + workDir + "; qsub " + fileNameToExecute + "_Batch.sh";
+    string subCommand = string("bash -l -c \"cd ") + workDir + "; qsub " + fileNameToExecute + "_Batch.sh\"";
     string command = _protocol.getExecCommand(subCommand, _hostname, _username);
     command += " > ";
     command += logFile;
@@ -138,7 +138,7 @@ namespace Batch {
     iss >> ref;
 
     // define command to delete batch
-    string subCommand = string("qdel ") + iss.str();
+    string subCommand = string("bash -l -c \"qdel ") + iss.str() + string("\"");
     string command = _protocol.getExecCommand(subCommand, _hostname, _username);
     cerr << command.c_str() << endl;
     status = system(command.c_str());
@@ -190,7 +190,7 @@ namespace Batch {
     string logFile = generateTemporaryFileName(string("SGE-querylog-id") + jobid.getReference());
 
     // define command to query batch
-    string subCommand = string("qstat | grep ") + iss.str();
+    string subCommand = string("bash -l -c \"qstat | grep ") + iss.str() + string("\"");
     string command = _protocol.getExecCommand(subCommand, _hostname, _username);
     command += " > ";
     command += logFile;
@@ -256,7 +256,7 @@ namespace Batch {
     tempOutputFile << "#! /bin/sh -f" << endl;
     if (queue != "")
       tempOutputFile << "#$ -q " << queue << endl;
-    tempOutputFile << "#$ -pe mpich " << nbproc << endl;
+    tempOutputFile << "#$ -pe " << _mpiImpl->name() << " " << nbproc << endl;
     if( edt > 0 )
       tempOutputFile << "#$ -l h_rt=" << getWallTime(edt) << endl ;
     if( mem > 0 )