Salome HOME
Add preprocess feature.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 7 Dec 2017 16:13:38 +0000 (17:13 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Thu, 7 Dec 2017 16:13:38 +0000 (17:13 +0100)
This feature allows to run a command on the frontal before the submission of
the batch.

26 files changed:
src/CCC/BatchManager_CCC.cxx
src/CCC/BatchManager_CCC.hxx
src/COORM/BatchManager_COORM.cxx
src/COORM/BatchManager_COORM.hxx
src/Core/BatchManager.cxx
src/Core/BatchManager.hxx
src/Core/Constants.cxx
src/Core/Constants.hxx
src/Core/ParameterTypeMap.cxx
src/Core/RunTimeException.hxx
src/LSF/BatchManager_LSF.cxx
src/LSF/BatchManager_LSF.hxx
src/LoadLeveler/BatchManager_LL.cxx
src/LoadLeveler/BatchManager_LL.hxx
src/Local/BatchManager_Local.cxx
src/Local/BatchManager_Local.hxx
src/OAR/BatchManager_OAR.cxx
src/OAR/BatchManager_OAR.hxx
src/PBS/BatchManager_PBS.cxx
src/PBS/BatchManager_PBS.hxx
src/SGE/BatchManager_SGE.cxx
src/SGE/BatchManager_SGE.hxx
src/Slurm/BatchManager_Slurm.cxx
src/Slurm/BatchManager_Slurm.hxx
src/Vishnu/BatchManager_Vishnu.cxx
src/Vishnu/BatchManager_Vishnu.hxx

index d2f05d2b66caefa0b19b98dfed17f2ce1e223196..03912ba82470b1d0fc0d402e4986b1500c3e8310 100644 (file)
@@ -73,7 +73,7 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : soumet un job au gestionnaire
-  const JobId BatchManager_CCC::submitJob(const Job & job)
+  const JobId BatchManager_CCC::runJob(const Job & job)
   {
     Parametre params = job.getParametre();
     const std::string workDir = params[WORKDIR];
@@ -82,10 +82,6 @@ namespace Batch {
     string::size_type p2 = fileToExecute.find_last_of(".");
     std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
 
-    // export input files on cluster
-    LOG("Export des fichiers en entree");
-    exportInputFiles(job);
-
     // build batch script for job
     LOG("Construction du script de batch");
     buildBatchScript(job);
index 9319033a8329afdf3de8bf7a7f454714a7edd876..916ddcc3c7d4b1884f33d0e76d2e6574e3ea3f64 100644 (file)
@@ -53,7 +53,7 @@ namespace Batch {
     // static string BatchManager_LSF::getDefaultServer();
 
     // Methodes pour le controle des jobs
-    virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+    virtual const JobId runJob(const Job & job); // soumet un job au gestionnaire
     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
     virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
     virtual bool isRunning(const JobId & jobid); // teste si un job est present en machine
index 24530be3abb152bd9727be6a21181b5b2ea44285..87dd529d329c6ef1ea6554f98ad21d47f9dd6a08 100644 (file)
@@ -31,234 +31,230 @@ using namespace std;
 
 namespace Batch
 {
-       BatchManager_COORM::BatchManager_COORM(const FactBatchManager * parent, const char * host,
-                       const char * username,
-                       CommunicationProtocolType protocolType, const char * mpiImpl)
-               : BatchManager(parent, host, username, protocolType, mpiImpl)
-       {
-       }
-
-       BatchManager_COORM::~BatchManager_COORM()
-       {
-       }
-
-       // Soumet un job au gestionnaire
-       const JobId BatchManager_COORM::submitJob(const Job & job)
-       {
-               Parametre params = job.getParametre();
-               const string workDir = params[WORKDIR];
-               const string fileToExecute = params[EXECUTABLE];
-
-               // For CooRM
-               const string launcherArgs = params[LAUNCHER_ARGS];
-               const string launcherFile  = params[LAUNCHER_FILE];
-
-               const string jobName = params[NAME];
-
-               string::size_type p1 = fileToExecute.find_last_of("/");
-               string::size_type p2 = fileToExecute.find_last_of(".");
-               std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
-
-               // For CooRM
-               p1 = launcherFile.find_last_of("/");
-               std::string fileNameToLaunch = launcherFile.substr(p1+1);
-
-
-               // export input files on cluster
-               exportInputFiles(job);
-
-               // build batch script for job
-               string scriptFile = buildBatchScript(job);
-
-               // Get REMOTE_COORM_PATH environment variable
-               const char * remote_coorm_path = getenv("REMOTE_COORM_PATH");
-               if (remote_coorm_path == NULL)
-               { 
-                       throw RunTimeException("Unable to get REMOTE_COORM_PATH environment variable");
-               }
-
-               // We need omniORB to execute launcher.py
-               const string set_env_cmd = "source " + string(remote_coorm_path) + "/coorm_prerequis.sh;";
-
-
-               // define command to submit batch
-               string subCommand = set_env_cmd + "python " + workDir + "/" + fileNameToLaunch + " --name="+ jobName +
-                                   " --workdir=" + workDir + " --outputs=" + workDir + "/logs/outputs.log" +
-                                   " --errors=" + workDir + "/logs/errors.log" +
-                                   " --executable=" + scriptFile + " " + launcherArgs;
-    string command = _protocol.getExecCommand(subCommand, _hostname, _username);
-    command += " 2>&1";
-    LOG(command);
-
-    // submit job
-    string output;
-    int status = Utils::getCommandOutput(command, output);
-    LOG(output);
-    if (status != 0) throw RunTimeException("Can't submit job, error was: " + output);
-
-    // read id of submitted job in output
-    istringstream logfile(output);
-    string sline, idline, id;
-
-               if (logfile)
-               {
-                       while (getline(logfile, sline) && sline != "")
-                       {
-                               idline = sline;
-                       }
-
-                       vector<string> tokens;
-                       JobInfo::Tokenize(idline, tokens, "=");
-                       id = tokens[1] ;        
-               }
-               else
-               {
-                       throw RunTimeException("Error in the submission of the job on the remote host");
-               }
-
-               JobId jobid(this, (string) id);
-               return jobid;
-       }
-
-       // retire un job du gestionnaire
-       void BatchManager_COORM::deleteJob(const JobId & jobid)
-       {
-    // Get REMOTE_COORM_PATH environment variable
-    const char * remote_coorm_path = getenv("REMOTE_COORM_PATH");
-    if (remote_coorm_path == NULL)
-    {
-      throw RunTimeException("Unable to get REMOTE_COORM_PATH environment variable");
-    }
-
-    // We need omniORB to execute launcher.py
-    const string set_env_cmd = "source " + string(remote_coorm_path) + "/coorm_prerequis.sh;";
-
-    // define command to delete job
-    string subCommand = set_env_cmd + "python " + string(remote_coorm_path) + "/coormdel.py --jobID=" + jobid.getReference();
-    string command = _protocol.getExecCommand(subCommand, _hostname, _username);
-    LOG(command);
-
-    int status = system(command.c_str());
-    if (status)
-      throw RunTimeException("Can't delete job " + jobid.getReference());
-
-    LOG("job " << jobid.getReference() << " killed");
-       }
-
-       // Renvoie l'etat du job
-       JobInfo BatchManager_COORM::queryJob(const JobId & jobid)
-       {
-               // Get REMOTE_COORM_PATH environment variable
-               const char * remote_coorm_path = getenv("REMOTE_COORM_PATH");
-               if (remote_coorm_path == NULL)
-               { 
-                       throw RunTimeException("Unable to get REMOTE_COORM_PATH environment variable");
-               }
-
-               // We need omniORB to execute launcher.py
-               const string set_env_cmd = "source " + string(remote_coorm_path) + "/coorm_prerequis.sh;";
-
-               // define command to query batch
-               string subCommand = set_env_cmd + "python " + string(remote_coorm_path) + "/coormstat.py --jobID=" + jobid.getReference();
-    string command = _protocol.getExecCommand(subCommand, _hostname, _username);
-    LOG(command);
-    string output;
-    int status = Utils::getCommandOutput(command, output);
-    if(status && status != 153 && status != 256*153)
-      throw RunTimeException("Error of connection on remote host");
-
-    JobInfo_COORM jobinfo = JobInfo_COORM(jobid.getReference(), output);
-    return jobinfo;
-       }
-
-       string BatchManager_COORM::buildBatchScript(const Job & job)
-       {
-               Parametre params = job.getParametre();
-
-               // Job Parameters
-               string workDir       = "";
-               string fileToExecute = "";
-               string tmpDir = "";
-               int nbproc               = 0;
-               int edt          = 0;
-               int mem              = 0;
-               string queue         = "";
-
-    // Mandatory parameters
-    if (params.find(WORKDIR) != params.end())
-      workDir = params[WORKDIR].str();
-    else
-      throw RunTimeException("params[WORKDIR] is not defined. Please define it, cannot submit this job.");
-    if (params.find(EXECUTABLE) != params.end())
-      fileToExecute = params[EXECUTABLE].str();
-    else
-      throw RunTimeException("params[EXECUTABLE] is not defined. Please define it, cannot submit this job.");
-
-               string::size_type p1 = fileToExecute.find_last_of("/");
-               string::size_type p2 = fileToExecute.find_last_of(".");
-               string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
-               string fileNameToExecute = fileToExecute.substr(p1+1);
-
-    // Create batch submit file
-    ofstream tempOutputFile;
-    string tmpFileName = Utils::createAndOpenTemporaryFile("COORM-script", tempOutputFile);
-
-               tempOutputFile << "#!/bin/sh -f" << endl;
-               tempOutputFile << "export LIBBATCH_NODEFILE=$COORM_NODEFILE" << endl;
-               // Launch the executable
-               tempOutputFile << "cd " << tmpDir << endl;
-               tempOutputFile << "./" + fileNameToExecute << endl;
-               tempOutputFile.flush();
-               tempOutputFile.close();
-
-               Utils::chmod(tmpFileName.c_str(), 0x1ED);
-               LOG("Batch script file generated is: " << tmpFileName);
-
-               string remoteFileName = rootNameToExecute + "_Batch.sh";
-    int status = _protocol.copyFile(tmpFileName, "", "",
-                                    workDir + "/" + remoteFileName,
-                                    _hostname, _username);
-    if (status)
-      throw RunTimeException("Cannot copy batch submission file on host " + _hostname);
-
-    return remoteFileName;
-       }
-
-       void BatchManager_COORM::exportInputFiles(const Job & job)
-       {
-               BatchManager::exportInputFiles(job);
-    
-               int status;
-               Parametre params = job.getParametre();
-
-               string launcherFile = params[LAUNCHER_FILE];
-
-               if (launcherFile.size() != 0) 
-               {
-                       // Copy launcherFile into batch working directory
-      status = _protocol.copyFile(launcherFile, "", "",
-                                  params[WORKDIR], _hostname, _username);
-      if (status) {
-        std::ostringstream oss;
-        oss << "Cannot copy file " << launcherFile << " on host " << _hostname;
-        oss << ". Return status is " << status;
-        throw RunTimeException(oss.str());
+      BatchManager_COORM::BatchManager_COORM(const FactBatchManager * parent, const char * host,
+                      const char * username,
+                      CommunicationProtocolType protocolType, const char * mpiImpl)
+              : BatchManager(parent, host, username, protocolType, mpiImpl)
+      {
       }
 
-      string remoteLauncher = launcherFile;
-      remoteLauncher = remoteLauncher.substr(remoteLauncher.rfind("/") + 1, remoteLauncher.length());
-      remoteLauncher = string(params[WORKDIR]) + "/" + remoteLauncher;
-
-      string subCommand = string("chmod u+x ") + remoteLauncher;
-      string command = _protocol.getExecCommand(subCommand, _hostname, _username);
-      LOG(command);
-      status = system(command.c_str());
-      if (status) {
-        std::ostringstream oss;
-        oss << "Cannot change permissions of file " << remoteLauncher << " on host " << _hostname;
-        oss << ". Return status is " << status;
-        throw RunTimeException(oss.str());
+      BatchManager_COORM::~BatchManager_COORM()
+      {
+      }
+
+      // Soumet un job au gestionnaire
+      const JobId BatchManager_COORM::runJob(const Job & job)
+      {
+              Parametre params = job.getParametre();
+              const string workDir = params[WORKDIR];
+              const string fileToExecute = params[EXECUTABLE];
+
+              // For CooRM
+              const string launcherArgs = params[LAUNCHER_ARGS];
+              const string launcherFile  = params[LAUNCHER_FILE];
+
+              const string jobName = params[NAME];
+
+              string::size_type p1 = fileToExecute.find_last_of("/");
+              string::size_type p2 = fileToExecute.find_last_of(".");
+              std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+
+              // For CooRM
+              p1 = launcherFile.find_last_of("/");
+              std::string fileNameToLaunch = launcherFile.substr(p1+1);
+
+              // build batch script for job
+              string scriptFile = buildBatchScript(job);
+
+              // Get REMOTE_COORM_PATH environment variable
+              const char * remote_coorm_path = getenv("REMOTE_COORM_PATH");
+              if (remote_coorm_path == NULL)
+              {
+                      throw RunTimeException("Unable to get REMOTE_COORM_PATH environment variable");
+              }
+
+              // We need omniORB to execute launcher.py
+              const string set_env_cmd = "source " + string(remote_coorm_path) + "/coorm_prerequis.sh;";
+
+
+              // define command to submit batch
+              string subCommand = set_env_cmd + "python " + workDir + "/" + fileNameToLaunch + " --name="+ jobName +
+                                  " --workdir=" + workDir + " --outputs=" + workDir + "/logs/outputs.log" +
+                                  " --errors=" + workDir + "/logs/errors.log" +
+                                  " --executable=" + scriptFile + " " + launcherArgs;
+              string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+              command += " 2>&1";
+              LOG(command);
+
+              // submit job
+              string output;
+              int status = Utils::getCommandOutput(command, output);
+              LOG(output);
+              if (status != 0) throw RunTimeException("Can't submit job, error was: " + output);
+
+              // read id of submitted job in output
+              istringstream logfile(output);
+              string sline, idline, id;
+
+              if (logfile)
+              {
+                while (getline(logfile, sline) && sline != "")
+                {
+                        idline = sline;
+                }
+
+                vector<string> tokens;
+                JobInfo::Tokenize(idline, tokens, "=");
+                id = tokens[1] ;
+              }
+              else
+              {
+                throw RunTimeException("Error in the submission of the job on the remote host");
+              }
+
+              JobId jobid(this, (string) id);
+              return jobid;
+              }
+
+              // retire un job du gestionnaire
+              void BatchManager_COORM::deleteJob(const JobId & jobid)
+              {
+              // Get REMOTE_COORM_PATH environment variable
+              const char * remote_coorm_path = getenv("REMOTE_COORM_PATH");
+              if (remote_coorm_path == NULL)
+              {
+                throw RunTimeException("Unable to get REMOTE_COORM_PATH environment variable");
+              }
+
+              // We need omniORB to execute launcher.py
+              const string set_env_cmd = "source " + string(remote_coorm_path) + "/coorm_prerequis.sh;";
+
+              // define command to delete job
+              string subCommand = set_env_cmd + "python " + string(remote_coorm_path) + "/coormdel.py --jobID=" + jobid.getReference();
+              string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+              LOG(command);
+
+              int status = system(command.c_str());
+              if (status)
+                throw RunTimeException("Can't delete job " + jobid.getReference());
+
+              LOG("job " << jobid.getReference() << " killed");
+      }
+
+      // Renvoie l'etat du job
+      JobInfo BatchManager_COORM::queryJob(const JobId & jobid)
+      {
+        // Get REMOTE_COORM_PATH environment variable
+        const char * remote_coorm_path = getenv("REMOTE_COORM_PATH");
+        if (remote_coorm_path == NULL)
+        {
+          throw RunTimeException("Unable to get REMOTE_COORM_PATH environment variable");
+        }
+
+        // We need omniORB to execute launcher.py
+        const string set_env_cmd = "source " + string(remote_coorm_path) + "/coorm_prerequis.sh;";
+
+        // define command to query batch
+        string subCommand = set_env_cmd + "python " + string(remote_coorm_path) + "/coormstat.py --jobID=" + jobid.getReference();
+        string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+        LOG(command);
+        string output;
+        int status = Utils::getCommandOutput(command, output);
+        if(status && status != 153 && status != 256*153)
+          throw RunTimeException("Error of connection on remote host");
+
+        JobInfo_COORM jobinfo = JobInfo_COORM(jobid.getReference(), output);
+        return jobinfo;
+      }
+
+      string BatchManager_COORM::buildBatchScript(const Job & job)
+      {
+        Parametre params = job.getParametre();
+
+        // Job Parameters
+        string workDir       = "";
+        string fileToExecute = "";
+        string tmpDir = "";
+        int nbproc              = 0;
+        int edt                 = 0;
+        int mem              = 0;
+        string queue         = "";
+
+        // Mandatory parameters
+        if (params.find(WORKDIR) != params.end())
+          workDir = params[WORKDIR].str();
+        else
+          throw RunTimeException("params[WORKDIR] is not defined. Please define it, cannot submit this job.");
+        if (params.find(EXECUTABLE) != params.end())
+          fileToExecute = params[EXECUTABLE].str();
+        else
+          throw RunTimeException("params[EXECUTABLE] is not defined. Please define it, cannot submit this job.");
+
+        string::size_type p1 = fileToExecute.find_last_of("/");
+        string::size_type p2 = fileToExecute.find_last_of(".");
+        string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+        string fileNameToExecute = fileToExecute.substr(p1+1);
+
+        // Create batch submit file
+        ofstream tempOutputFile;
+        string tmpFileName = Utils::createAndOpenTemporaryFile("COORM-script", tempOutputFile);
+
+        tempOutputFile << "#!/bin/sh -f" << endl;
+        tempOutputFile << "export LIBBATCH_NODEFILE=$COORM_NODEFILE" << endl;
+        // Launch the executable
+        tempOutputFile << "cd " << tmpDir << endl;
+        tempOutputFile << "./" + fileNameToExecute << endl;
+        tempOutputFile.flush();
+        tempOutputFile.close();
+
+        Utils::chmod(tmpFileName.c_str(), 0x1ED);
+        LOG("Batch script file generated is: " << tmpFileName);
+
+        string remoteFileName = rootNameToExecute + "_Batch.sh";
+        int status = _protocol.copyFile(tmpFileName, "", "",
+                                        workDir + "/" + remoteFileName,
+                                        _hostname, _username);
+        if (status)
+          throw RunTimeException("Cannot copy batch submission file on host " + _hostname);
+
+        return remoteFileName;
+      }
+
+      void BatchManager_COORM::exportInputFiles(const Job & job)
+      {
+        BatchManager::exportInputFiles(job);
+
+        int status;
+        Parametre params = job.getParametre();
+
+        string launcherFile = params[LAUNCHER_FILE];
+
+        if (launcherFile.size() != 0)
+        {
+          // Copy launcherFile into batch working directory
+          status = _protocol.copyFile(launcherFile, "", "",
+                                      params[WORKDIR], _hostname, _username);
+          if (status) {
+            std::ostringstream oss;
+            oss << "Cannot copy file " << launcherFile << " on host " << _hostname;
+            oss << ". Return status is " << status;
+            throw RunTimeException(oss.str());
+          }
+
+          string remoteLauncher = launcherFile;
+          remoteLauncher = remoteLauncher.substr(remoteLauncher.rfind("/") + 1, remoteLauncher.length());
+          remoteLauncher = string(params[WORKDIR]) + "/" + remoteLauncher;
+
+          string subCommand = string("chmod u+x ") + remoteLauncher;
+          string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+          LOG(command);
+          status = system(command.c_str());
+          if (status) {
+            std::ostringstream oss;
+            oss << "Cannot change permissions of file " << remoteLauncher << " on host " << _hostname;
+            oss << ". Return status is " << status;
+            throw RunTimeException(oss.str());
+          }
+        }
       }
-               }
-       }
 }
index 9dbc4cfbea82da346ad4b3d0ee789892b0540622..87abb2469747e9b027898dcc643bcb32b9a00071 100644 (file)
 
 namespace Batch
 {
-       class BATCH_EXPORT BatchManager_COORM : public BatchManager
-       {
-               public:
-                       // Constructeur
-                       BatchManager_COORM(const FactBatchManager * parent, const char * host="localhost",
-                                       const char * username="",
-                                       CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi");
+      class BATCH_EXPORT BatchManager_COORM : public BatchManager
+      {
+              public:
+                      // Constructeur
+                      BatchManager_COORM(const FactBatchManager * parent, const char * host="localhost",
+                                      const char * username="",
+                                      CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi");
 
-                       // Destructeur
-                       virtual ~BatchManager_COORM();
+                      // Destructeur
+                      virtual ~BatchManager_COORM();
 
-                       // Soumet un job
-                       virtual const JobId submitJob(const Job & job);
+                      // Soumet un job
+                      virtual const JobId runJob(const Job & job);
 
-                       // Supprime un job
-                       virtual void deleteJob(const JobId & jobid);
+                      // Supprime un job
+                      virtual void deleteJob(const JobId & jobid);
 
-                       // Donne l'etat du job
-                       virtual JobInfo queryJob(const JobId & jobid);
+                      // Donne l'etat du job
+                      virtual JobInfo queryJob(const JobId & jobid);
 
-                       // Modifie un job en file d'attente
-                       virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); }
+                      // Modifie un job en file d'attente
+                      virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); }
 
-                       // Modifie un job en file d'attente
-                       virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); }
+                      // Modifie un job en file d'attente
+                      virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); }
 
-               protected:
-                       std::string buildBatchScript(const Job & job);
-                       void exportInputFiles(const Job & job);
+              protected:
+                      std::string buildBatchScript(const Job & job);
+                      void exportInputFiles(const Job & job);
 
 #ifdef SWIG
-               public:
-                       // Recupere le l'identifiant d'un job deja soumis au BatchManager
-                       virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
+              public:
+                      // Recupere le l'identifiant d'un job deja soumis au BatchManager
+                      virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
 #endif
-       };
+      };
 }
 
 #endif
index 4645ffbb554f0ae26ca24cb9c41f9c7f4849d009..c50266fe91d184415ec81cce0d54b268fc1e8331 100644 (file)
@@ -78,7 +78,9 @@ namespace Batch {
   // Methode pour le controle des jobs : soumet un job au gestionnaire
   const JobId BatchManager::submitJob(const Job & job)
   {
-    throw NotYetImplementedException("Method submitJob not implemented by Batch Manager \"" + _type + "\"");
+    exportInputFiles(job);
+    preprocess(job);
+    return runJob(job);
   }
 
   // Methode pour le controle des jobs : retire un job du gestionnaire
@@ -360,4 +362,35 @@ namespace Batch {
     return _protocol;
   }
 
+  void BatchManager::preprocess(const Batch::Job & job)
+  {
+    std::string preproCommand;
+    std::string workDir;
+    Parametre params = job.getParametre();
+    if (params.find(PREPROCESS) != params.end())
+      preproCommand = params[PREPROCESS].str();
+    if (params.find(WORKDIR) != params.end())
+      workDir = params[WORKDIR].str();
+
+    if(!preproCommand.empty() && !workDir.empty())
+    {
+      std::string subCommand = "cd " + workDir + "; " + preproCommand;
+      std::string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+      command += " 2>&1";
+      LOG(command);
+
+      // submit job
+      std::string output;
+      int status = Utils::getCommandOutput(command, output);
+      LOG(output);
+      if (status != 0)
+        throw RunTimeException("Error when executing: " + command +
+                               "\nOutput:" + output);
+    }
+  }
+  
+  const Batch::JobId BatchManager::runJob(const Batch::Job & job)
+  {
+    throw NotYetImplementedException("Method runJob not implemented by Batch Manager \"" + _type + "\"");
+  }
 }
index 7d78f9c35e439ad03d68de8134e35d550979cf71..9bc9dddf780cc3cbd685c7eeefcdb0fd2aea7873 100644 (file)
@@ -94,7 +94,15 @@ namespace Batch {
     MpiImpl *_mpiImpl; // Mpi implementation to launch executable in batch script
 
     MpiImpl* FactoryMpiImpl(std::string mpiImpl);
-    void exportInputFiles(const Job & job);
+    virtual void exportInputFiles(const Job & job);
+    
+    // Preprocessing done on the frontal using "PREPROCESS" parameter as a script.
+    // May throw exceptions in case of failure.
+    virtual void preprocess(const Batch::Job & job);
+    
+    // Submit to batch manager, but we suppose input files are already copied
+    // and preprocess finished without error
+    virtual const Batch::JobId runJob(const Batch::Job & job);
 
   private:
 
index 13521800f7a1b76037ca42de2f02cdac454b44e9..480919facefceb083a8e19930ac3f162fd52efc4 100644 (file)
@@ -52,6 +52,7 @@ namespace Batch {
   def_Constant(MEMPERCPU);
   def_Constant(WCKEY);
   def_Constant(EXTRAPARAMS);
+  def_Constant(PREPROCESS);
 
   // Parameters for COORM
   def_Constant(LAUNCHER_FILE);
index 6c7552af80705c96c0f7a50d00152ede5e85cbcd..ac07e1d468e2bfb5409840f1a3be7ab39c3aeb75 100644 (file)
@@ -63,6 +63,7 @@ namespace Batch {
   decl_extern_Constant(MEMPERCPU);
   decl_extern_Constant(WCKEY);
   decl_extern_Constant(EXTRAPARAMS);
+  decl_extern_Constant(PREPROCESS);
 
   // Parameters for COORM
   decl_extern_Constant(LAUNCHER_FILE);
index 897eede280209b5d669c46c51c59b91e762009fe..8b23095d13d721af15be614c7ee3d62953345404 100644 (file)
@@ -65,8 +65,9 @@ namespace Batch {
     addParameter("MEMPERCPU", LONG, 1);
     addParameter("WCKEY", STRING, 1);
     addParameter("EXTRAPARAMS", STRING, 1);
+    addParameter("PREPROCESS", STRING, 1);
 
-       // Parameters for COORM
+    // Parameters for COORM
     addParameter("LAUNCHER_FILE", STRING, 1);
     addParameter("LAUNCHER_ARGS", STRING, 1);
   }
index 09a37e12361d846ea5f527e19c3b8a76406d18fd..6bb01e6c58542989af94850cab93dce4678b31f8 100644 (file)
@@ -42,7 +42,7 @@ namespace Batch {
   class BATCH_EXPORT RunTimeException : public GenericException
   {
   public:
-               // Constructeur
+    // Constructeur
     RunTimeException(std::string ch = "undefined") : GenericException("RunTimeException", ch) {}
   };
 
index 7956303ede8864a99353022380511ac3bc7d8e7f..732ff0b4b435cfb71a8ff2312ec0b4a69698b4bc 100644 (file)
@@ -59,15 +59,11 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : soumet un job au gestionnaire
-  const JobId BatchManager_LSF::submitJob(const Job & job)
+  const JobId BatchManager_LSF::runJob(const Job & job)
   {
     Parametre params = job.getParametre();
     const std::string workDir = params[WORKDIR];
 
-    // export input files on cluster
-    LOG("Export des fichiers en entree");
-    exportInputFiles(job);
-
     // build batch script for job
     LOG("Construction du script de batch");
     string scriptFile = buildSubmissionScript(job);
index 3d6fb1e2992759a3d635fe79d78102dc995042b0..d52160945b86a2dedaae58da83f393d90f853764 100644 (file)
@@ -53,7 +53,7 @@ namespace Batch {
     // static string BatchManager_LSF::getDefaultServer();
 
     // Methodes pour le controle des jobs
-    virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+    virtual const JobId runJob(const Job & job); // soumet un job au gestionnaire
     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
     virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
     virtual bool isRunning(const JobId & jobid); // teste si un job est present en machine
index 4f89f04e3a812f88ea3132e15565deef3f304b56..53396edd6de4de75ad0c45e77863f7d4d32da4b3 100644 (file)
@@ -57,14 +57,11 @@ namespace Batch {
   }
 
   // Method to submit a job to the batch manager
-  const JobId BatchManager_LL::submitJob(const Job & job)
+  const JobId BatchManager_LL::runJob(const Job & job)
   {
     Parametre params = job.getParametre();
     const string workDir = params[WORKDIR];
 
-    // export input files on cluster
-    exportInputFiles(job);
-
     // build command file to submit the job and copy it on the server
     string cmdFile = buildCommandFile(job);
 
index cbff7f006bc0c315b0fac492e9a3c5a030144999..716cd19aa53f7da1aa64ea4bf2af2d1194d45ab5 100644 (file)
@@ -48,7 +48,7 @@ namespace Batch {
     virtual ~BatchManager_LL();
 
     // Methods to control jobs
-    virtual const JobId submitJob(const Job & job);
+    virtual const JobId runJob(const Job & job);
     virtual void deleteJob(const JobId & jobid);
     virtual JobInfo queryJob(const JobId & jobid);
 
index 0c089939c095cde71e713811d38b0a5e86825eec..f913ee653f93fdc5d8b99d4222856b739c25ff7c 100644 (file)
@@ -93,11 +93,8 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : soumet un job au gestionnaire
-  const JobId BatchManager_Local::submitJob(const Job & job)
+  const JobId BatchManager_Local::runJob(const Job & job)
   {
-    // export input files in the working directory of the execution host
-    exportInputFiles(job);
-
     Job_Local jobLocal = job;
     Id id = _idCounter++;
     ThreadAdapter * p_ta = new ThreadAdapter(*this, job, id);
index 4f7e0fb004e2d27f3d2fb0baf2ce153d756da873..d4e89d8112be7bba9a939f4014786d57d0a59ec0 100644 (file)
@@ -132,7 +132,7 @@ namespace Batch {
     // static string BatchManager_Local::getDefaultServer();
 
     // Methodes pour le controle des jobs
-    virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+    virtual const JobId runJob(const Job & job); // soumet un job au gestionnaire
     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
     virtual void holdJob(const JobId & jobid); // suspend un job en file d'attente
     virtual void releaseJob(const JobId & jobid); // relache un job suspendu
index 503ad8dfdea51b05d618159cdf9da907be57b98f..0989bf2889a8445edc2f105ecb3bb468bfa1c9e0 100644 (file)
@@ -31,36 +31,33 @@ using namespace std;
 
 namespace Batch
 {
-       BatchManager_OAR::BatchManager_OAR(const FactBatchManager * parent, const char * host,
-                       const char * username,
-                       CommunicationProtocolType protocolType, const char * mpiImpl)
-               : BatchManager(parent, host, username, protocolType, mpiImpl)
-       {
-       }
-
-       BatchManager_OAR::~BatchManager_OAR()
-       {
-       }
-
-       // Soumet un job au gestionnaire
-       const JobId BatchManager_OAR::submitJob(const Job & job)
-       {
-               Parametre params = job.getParametre();
-               const string workDir = params[WORKDIR];
-               const string fileToExecute = params[EXECUTABLE];
-               string::size_type p1 = fileToExecute.find_last_of("/");
-               string::size_type p2 = fileToExecute.find_last_of(".");
-               std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
-
-               // export input files on cluster
-               exportInputFiles(job);
-
-               // build batch script for job
-               string scriptFile = buildBatchScript(job);
+  BatchManager_OAR::BatchManager_OAR(const FactBatchManager * parent, const char * host,
+                  const char * username,
+                  CommunicationProtocolType protocolType, const char * mpiImpl)
+          : BatchManager(parent, host, username, protocolType, mpiImpl)
+  {
+  }
+
+  BatchManager_OAR::~BatchManager_OAR()
+  {
+  }
+
+  // Soumet un job au gestionnaire
+  const JobId BatchManager_OAR::runJob(const Job & job)
+  {
+    Parametre params = job.getParametre();
+    const string workDir = params[WORKDIR];
+    const string fileToExecute = params[EXECUTABLE];
+    string::size_type p1 = fileToExecute.find_last_of("/");
+    string::size_type p2 = fileToExecute.find_last_of(".");
+    std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+
+    // build batch script for job
+    string scriptFile = buildBatchScript(job);
 
     // define command to submit batch
-               string subCommand = string("oarsub -t allow_classic_ssh -d ") + workDir + " -S " + workDir + "/" + scriptFile;
-               string command = _protocol.getExecCommand(subCommand, _hostname, _username);
+    string subCommand = string("oarsub -t allow_classic_ssh -d ") + workDir + " -S " + workDir + "/" + scriptFile;
+    string command = _protocol.getExecCommand(subCommand, _hostname, _username);
     command += " 2>&1";
     LOG(command);
 
@@ -70,33 +67,33 @@ namespace Batch
     LOG(output);
     if (status != 0) throw RunTimeException("Can't submit job, error was: " + output);
 
-               // read id of submitted job in output
-               istringstream logfile(output);
-               string sline, idline, id;
-
-               if (logfile)
-               {
-                       while (getline(logfile, sline) && sline != "")
-                       {
-                               idline = sline;
-                       }
-
-                       vector<string> tokens;
-                       JobInfo::Tokenize(idline, tokens, "=");
-                       id = tokens[1];
-               }
-               else
-               {
-                       throw RunTimeException("Error in the submission of the job on the remote host");
-               }
-
-               JobId jobid(this, id);
-               return jobid;
-       }
-
-       // retire un job du gestionnaire
-       void BatchManager_OAR::deleteJob(const JobId & jobid)
-       {
+    // read id of submitted job in output
+    istringstream logfile(output);
+    string sline, idline, id;
+
+    if (logfile)
+    {
+      while (getline(logfile, sline) && sline != "")
+      {
+        idline = sline;
+      }
+
+      vector<string> tokens;
+      JobInfo::Tokenize(idline, tokens, "=");
+      id = tokens[1];
+    }
+    else
+    {
+      throw RunTimeException("Error in the submission of the job on the remote host");
+    }
+
+    JobId jobid(this, id);
+    return jobid;
+  }
+
+  // retire un job du gestionnaire
+  void BatchManager_OAR::deleteJob(const JobId & jobid)
+  {
     // define command to delete job
     string subCommand = "oardel " + jobid.getReference();
     string command = _protocol.getExecCommand(subCommand, _hostname, _username);
@@ -107,11 +104,11 @@ namespace Batch
       throw RunTimeException("Can't delete job " + jobid.getReference());
 
     LOG("job " << jobid.getReference() << " killed");
-       }
+  }
 
-       // Renvoie l'etat du job
-       JobInfo BatchManager_OAR::queryJob(const JobId & jobid)
-       {
+  // Renvoie l'etat du job
+  JobInfo BatchManager_OAR::queryJob(const JobId & jobid)
+  {
     // define command to query batch
     string subCommand = "oarstat -fj " + jobid.getReference();
     string command = _protocol.getExecCommand(subCommand, _hostname, _username);
@@ -123,19 +120,19 @@ namespace Batch
 
     JobInfo_OAR jobinfo = JobInfo_OAR(jobid.getReference(), output);
     return jobinfo;
-       }
+  }
 
-       string BatchManager_OAR::buildBatchScript(const Job & job)
-       {
-               Parametre params = job.getParametre();
+  string BatchManager_OAR::buildBatchScript(const Job & job)
+  {
+    Parametre params = job.getParametre();
 
-               // Job Parameters
-               string workDir       = "";
-               string fileToExecute = "";
-               string tmpDir = "";
-               int nbproc               = 0;
-               int mem              = 0;
-               string queue         = "";
+    // Job Parameters
+    string workDir       = "";
+    string fileToExecute = "";
+    string tmpDir = "";
+    int nbproc          = 0;
+    int mem              = 0;
+    string queue         = "";
 
     // Mandatory parameters
     if (params.find(WORKDIR) != params.end())
@@ -147,85 +144,85 @@ namespace Batch
     else
       throw RunTimeException("params[EXECUTABLE] is not defined. Please define it, cannot submit this job.");
 
-               // Optional parameters
-               if (params.find(NBPROC) != params.end()) 
-                       nbproc = params[NBPROC];
+    // Optional parameters
+    if (params.find(NBPROC) != params.end())
+            nbproc = params[NBPROC];
     int nbprocpernode = 1;
     if (params.find(NBPROCPERNODE) != params.end())
       nbprocpernode = params[NBPROCPERNODE];
     long walltimeSecs = 0;
-               if (params.find(MAXWALLTIME) != params.end()) 
-                 walltimeSecs = (long)params[MAXWALLTIME] * 60;
-               if (params.find(MAXRAMSIZE) != params.end()) 
-                       mem = params[MAXRAMSIZE];
-               if (params.find(QUEUE) != params.end()) 
-                       queue = params[QUEUE].str();
-
-               string::size_type p1 = fileToExecute.find_last_of("/");
-               string::size_type p2 = fileToExecute.find_last_of(".");
-               string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
-               string fileNameToExecute = fileToExecute.substr(p1+1);
-
-               // Create batch submit file
+    if (params.find(MAXWALLTIME) != params.end())
+      walltimeSecs = (long)params[MAXWALLTIME] * 60;
+    if (params.find(MAXRAMSIZE) != params.end())
+            mem = params[MAXRAMSIZE];
+    if (params.find(QUEUE) != params.end())
+            queue = params[QUEUE].str();
+
+    string::size_type p1 = fileToExecute.find_last_of("/");
+    string::size_type p2 = fileToExecute.find_last_of(".");
+    string rootNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
+    string fileNameToExecute = fileToExecute.substr(p1+1);
+
+    // Create batch submit file
     ofstream tempOutputFile;
     string tmpFileName = Utils::createAndOpenTemporaryFile("OAR-script", tempOutputFile);
 
-               tempOutputFile << "#!/bin/sh -f" << endl;
-
-               int nb_full_nodes(0);
-               int nb_proc_on_last_node(0);
-
-               if (nbproc > 0)
-               {
-                       nb_full_nodes = nbproc / nbprocpernode;
-                       nb_proc_on_last_node = nbproc % nbprocpernode;
-
-                       // In exclusive mode, we reserve all procs on the nodes
-                       if (params.find(EXCLUSIVE) != params.end() && params[EXCLUSIVE] && nb_proc_on_last_node > 0)
-                       {
-                               nb_full_nodes += 1;
-                               nb_proc_on_last_node = 0;
-                       }
-               }
-
-               if (nb_full_nodes > 0)
-               {
-                       tempOutputFile << "#OAR -l nodes=" << nb_full_nodes;
-                       if (walltimeSecs > 0)
-                       {
-                               tempOutputFile << ",walltime=" << convertSecTo_H_M_S(walltimeSecs) << endl;
-                       }
-                       else
-                       {
-                               tempOutputFile << endl;
-                       }
-               }
-               else
-               {
-                       if (walltimeSecs > 0)
-                       {
-                               tempOutputFile << "#OAR -l walltime=" << convertSecTo_H_M_S(walltimeSecs) << endl;
-                       }
-               }
-
-               if (queue != "")
-               {
-                       tempOutputFile << "#OAR -q " << queue << endl;
-               }
-
-               tempOutputFile << "#OAR -O " << tmpDir << "/logs/output.log." << rootNameToExecute << endl;
-               tempOutputFile << "#OAR -E " << tmpDir << "/logs/error.log."  << rootNameToExecute << endl;
-
-               tempOutputFile << "export LIBBATCH_NODEFILE=$OAR_NODEFILE" << endl;
-
-               // Launch the executable
-               tempOutputFile << "cd " << tmpDir << endl;
-               tempOutputFile << "./" + fileNameToExecute << endl;
-               tempOutputFile.flush();
-               tempOutputFile.close();
-
-               Utils::chmod(tmpFileName.c_str(), 0x1ED);
-               LOG("Batch script file generated is: " << tmpFileName);
+    tempOutputFile << "#!/bin/sh -f" << endl;
+
+    int nb_full_nodes(0);
+    int nb_proc_on_last_node(0);
+
+    if (nbproc > 0)
+    {
+      nb_full_nodes = nbproc / nbprocpernode;
+      nb_proc_on_last_node = nbproc % nbprocpernode;
+
+      // In exclusive mode, we reserve all procs on the nodes
+      if (params.find(EXCLUSIVE) != params.end() && params[EXCLUSIVE] && nb_proc_on_last_node > 0)
+      {
+        nb_full_nodes += 1;
+        nb_proc_on_last_node = 0;
+      }
+    }
+
+    if (nb_full_nodes > 0)
+    {
+      tempOutputFile << "#OAR -l nodes=" << nb_full_nodes;
+      if (walltimeSecs > 0)
+      {
+        tempOutputFile << ",walltime=" << convertSecTo_H_M_S(walltimeSecs) << endl;
+      }
+      else
+      {
+        tempOutputFile << endl;
+      }
+    }
+    else
+    {
+      if (walltimeSecs > 0)
+      {
+        tempOutputFile << "#OAR -l walltime=" << convertSecTo_H_M_S(walltimeSecs) << endl;
+      }
+    }
+
+    if (queue != "")
+    {
+      tempOutputFile << "#OAR -q " << queue << endl;
+    }
+
+    tempOutputFile << "#OAR -O " << tmpDir << "/logs/output.log." << rootNameToExecute << endl;
+    tempOutputFile << "#OAR -E " << tmpDir << "/logs/error.log."  << rootNameToExecute << endl;
+
+    tempOutputFile << "export LIBBATCH_NODEFILE=$OAR_NODEFILE" << endl;
+
+    // Launch the executable
+    tempOutputFile << "cd " << tmpDir << endl;
+    tempOutputFile << "./" + fileNameToExecute << endl;
+    tempOutputFile.flush();
+    tempOutputFile.close();
+
+    Utils::chmod(tmpFileName.c_str(), 0x1ED);
+    LOG("Batch script file generated is: " << tmpFileName);
 
     string remoteFileName = rootNameToExecute + "_Batch.sh";
     int status = _protocol.copyFile(tmpFileName, "", "",
@@ -235,17 +232,17 @@ namespace Batch
       throw RunTimeException("Cannot copy batch submission file on host " + _hostname);
 
     return remoteFileName;
-       }
-
-       string BatchManager_OAR::convertSecTo_H_M_S(long seconds) const
-       {
-               int h(seconds / 3600);
-               int m((seconds % 3600) / 60);
-               int s((seconds % 3600) % 60);
-
-               stringstream ss;
-               ss << h << ":" << m << ":" << s;
-               
-               return ss.str();
-       }
+  }
+
+  string BatchManager_OAR::convertSecTo_H_M_S(long seconds) const
+  {
+    int h(seconds / 3600);
+    int m((seconds % 3600) / 60);
+    int s((seconds % 3600) % 60);
+
+    stringstream ss;
+    ss << h << ":" << m << ":" << s;
+
+    return ss.str();
+  }
 }
index 9e186d46257c1c4792e3a767f014f9f7bbe1214e..8adb876294e0b768bfdce7738802d005950d971b 100644 (file)
 
 namespace Batch
 {
-       class BATCH_EXPORT BatchManager_OAR : public BatchManager
-       {
-               public:
-                       // Constructeur
-                       BatchManager_OAR(const FactBatchManager * parent, const char * host="localhost",
-                                       const char * username="",
-                                       CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi");
+  class BATCH_EXPORT BatchManager_OAR : public BatchManager
+  {
+    public:
+      // Constructeur
+      BatchManager_OAR(const FactBatchManager * parent, const char * host="localhost",
+                      const char * username="",
+                      CommunicationProtocolType protocolType = SSH, const char * mpiImpl="nompi");
 
-                       // Destructeur
-                       virtual ~BatchManager_OAR();
+      // Destructeur
+      virtual ~BatchManager_OAR();
 
-                       // Soumet un job
-                       virtual const JobId submitJob(const Job & job);
+      // Soumet un job
+      virtual const JobId runJob(const Job & job);
 
-                       // Supprime un job
-                       virtual void deleteJob(const JobId & jobid);
+      // Supprime un job
+      virtual void deleteJob(const JobId & jobid);
 
-                       // Donne l'etat du job
-                       virtual JobInfo queryJob(const JobId & jobid);
+      // Donne l'etat du job
+      virtual JobInfo queryJob(const JobId & jobid);
 
-                       // Modifie un job en file d'attente
-                       virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); }
+      // Modifie un job en file d'attente
+      virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); }
 
-                       // Modifie un job en file d'attente
-                       virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); }
+      // Modifie un job en file d'attente
+      virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); }
 
-               protected:
-                       std::string buildBatchScript(const Job & job);
-                       std::string convertSecTo_H_M_S(long seconds) const;
+    protected:
+      std::string buildBatchScript(const Job & job);
+      std::string convertSecTo_H_M_S(long seconds) const;
 
 #ifdef SWIG
-               public:
-                       // Recupere le l'identifiant d'un job deja soumis au BatchManager
-                       virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
+    public:
+      // Recupere l'identifiant d'un job deja soumis au BatchManager
+      virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
 #endif
-       };
+  };
 }
 
 #endif
index 14255ba7140bc2c3108adddb6d289ef42f4cd176..f8ab1fe6726fe11368afe140b1b149e68b4a8e22 100644 (file)
@@ -60,14 +60,11 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : soumet un job au gestionnaire
-  const JobId BatchManager_PBS::submitJob(const Job & job)
+  const JobId BatchManager_PBS::runJob(const Job & job)
   {
     Parametre params = job.getParametre();
     const std::string workDir = params[WORKDIR];
 
-    // export input files on cluster
-    exportInputFiles(job);
-
     // build batch script for job
     string scriptFile = buildSubmissionScript(job);
 
index 9cbd3a69beb680d9fc7314cc1ef4221d2dc04f4d..2de7f452245694ce70e3c25ed975d37842d6d0e0 100644 (file)
@@ -53,7 +53,7 @@ namespace Batch {
     // static string BatchManager_LSF::getDefaultServer();
 
     // Methodes pour le controle des jobs
-    virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+    virtual const JobId runJob(const Job & job); // soumet un job au gestionnaire
     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
     virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
     virtual bool isRunning(const JobId & jobid); // teste si un job est present en machine
index 3eee6b43ecbd2f13042da196b067531ea1b640b1..f89e2fb2e4e8c7f0074a6522065dce80357c3742 100644 (file)
@@ -72,7 +72,7 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : soumet un job au gestionnaire
-  const JobId BatchManager_SGE::submitJob(const Job & job)
+  const JobId BatchManager_SGE::runJob(const Job & job)
   {
     Parametre params = job.getParametre();
     const std::string workDir = params[WORKDIR];
@@ -81,9 +81,6 @@ namespace Batch {
     string::size_type p2 = fileToExecute.find_last_of(".");
     std::string fileNameToExecute = fileToExecute.substr(p1+1,p2-p1-1);
 
-    // export input files on cluster
-    exportInputFiles(job);
-
     // build batch script for job
     buildBatchScript(job);
 
index e9065a3ecb319bd1900b3514ccb4812063a630cd..8ef6a0f0ba36cd3f4dd062e5cfe1df2188220065 100644 (file)
@@ -53,7 +53,7 @@ namespace Batch {
     // static string BatchManager_LSF::getDefaultServer();
 
     // Methodes pour le controle des jobs
-    virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
+    virtual const JobId runJob(const Job & job); // soumet un job au gestionnaire
     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
     virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
     virtual bool isRunning(const JobId & jobid); // teste si un job est present en machine
index b7683863d8e9b2142ad26f79e6e6d1d2edf90ed8..4bb013d36ca7ed5f0ad66b5ae27f7adbf62f23c7 100644 (file)
@@ -55,14 +55,11 @@ namespace Batch {
   }
 
   // Method to submit a job to the batch manager
-  const JobId BatchManager_Slurm::submitJob(const Job & job)
+  const JobId BatchManager_Slurm::runJob(const Job & job)
   {
     Parametre params = job.getParametre();
     const string workDir = params[WORKDIR];
 
-    // export input files on cluster
-    exportInputFiles(job);
-
     // build command file to submit the job and copy it on the server
     string cmdFile = buildCommandFile(job);
 
index 7ee37a220c434fd284842aef2228e9f9986ece8a..f21b27d7da48e24ae321d6b3f0deffd8fe7bad7d 100644 (file)
@@ -51,7 +51,7 @@ namespace Batch {
     virtual ~BatchManager_Slurm();
 
     // Methods to control jobs
-    virtual const JobId submitJob(const Job & job);
+    virtual const JobId runJob(const Job & job);
     virtual void deleteJob(const JobId & jobid);
     virtual JobInfo queryJob(const JobId & jobid);
 
index 09aacf0b42fae7d17533e24f1148a035df3b1685..ef518a4b4e29fec04bd9137fcfa02ecac4bf3bd7 100644 (file)
@@ -61,11 +61,8 @@ namespace Batch {
   }
 
   // Method to submit a job to the batch manager
-  const JobId BatchManager_Vishnu::submitJob(const Job & job)
+  const JobId BatchManager_Vishnu::runJob(const Job & job)
   {
-    // export input files on cluster
-    exportInputFiles(job);
-
     // build command file to submit the job
     string cmdFile = buildCommandFile(job);
 
index 7b4b8fceeb521eb284faf4d2a939b0c18bd06429..5ac9087cc61a5c9aa5ee4d6e7ff2069181d33c4c 100644 (file)
@@ -51,7 +51,7 @@ namespace Batch {
     virtual ~BatchManager_Vishnu();
 
     // Methods to control jobs
-    virtual const JobId submitJob(const Job & job);
+    virtual const JobId runJob(const Job & job);
     virtual void deleteJob(const JobId & jobid);
     virtual JobInfo queryJob(const JobId & jobid);
     virtual void importOutputFiles(const Job & job, const std::string directory);