Salome HOME
Merge class BatchManager_eClient into class BatchManager
[tools/libbatch.git] / src / Vishnu / Batch_BatchManager_eVishnu.cxx
index 9c39013bfe48069e664b5eef4105b458c42c09c5..61ec2fd1521994399aed774691601196cf7a9f8d 100644 (file)
@@ -52,9 +52,8 @@ namespace Batch {
                                              CommunicationProtocolType protocolType,
                                              const char * mpiImpl,
                                              int nb_proc_per_node)
-    : BatchManager(parent, host),
-      // Force SH protocol for Vishnu
-      BatchManager_eClient(parent, host, username, SH, mpiImpl),
+    : // Force SH protocol for Vishnu
+      BatchManager(parent, host, username, SH, mpiImpl),
       _nb_proc_per_node(nb_proc_per_node)
   {
   }
@@ -93,19 +92,19 @@ namespace Batch {
     string output;
     int status = Utils::getCommandOutput(command, output);
     cout << output;
-    if (status != 0) throw EmulationException("Can't submit job, error was: " + output);
+    if (status != 0) throw RunTimeException("Can't submit job, error was: " + output);
 
     // find id of submitted job in output
     string search = "Job Id     : ";
     string::size_type pos = output.find(search);
     if (pos == string::npos)
-      throw EmulationException("Error in the submission of the job on the remote host");
+      throw RunTimeException("Error in the submission of the job on the remote host");
     pos += search.size();
     string::size_type endl_pos = output.find('\n', pos);
     string::size_type count = (endl_pos == string::npos)? string::npos : endl_pos - pos;
     string jobref = output.substr(pos, count);
     if (jobref.size() == 0)
-      throw EmulationException("Error in the submission of the job on the remote host");
+      throw RunTimeException("Error in the submission of the job on the remote host");
 
     JobId id(this, jobref);
     return id;
@@ -161,7 +160,7 @@ namespace Batch {
     int status = Utils::getCommandOutput(command, output);
     cout << output;
     if (status != 0)
-      throw EmulationException("Can't copy input files, error was: " + output);
+      throw RunTimeException("Can't copy input files, error was: " + output);
   }
 
   /**
@@ -181,11 +180,11 @@ namespace Batch {
     if (params.find(WORKDIR) != params.end()) 
       workDir = params[WORKDIR].str();
     else 
-      throw EmulationException("params[WORKDIR] is not defined. Please define it, cannot submit this job.");
+      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 EmulationException("params[EXECUTABLE] is not defined. Please define it, cannot submit this job.");
+      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(".");
@@ -194,7 +193,7 @@ namespace Batch {
 
     // Create batch submit file
     ofstream tempOutputFile;
-    string tmpFileName = createAndOpenTemporaryFile("vishnu-script", tempOutputFile);
+    string tmpFileName = Utils::createAndOpenTemporaryFile("vishnu-script", tempOutputFile);
 
     tempOutputFile << "#!/bin/sh" << endl;
     tempOutputFile << "#% vishnu_output=" << workDir << "/logs/output.log." << rootNameToExecute << endl;
@@ -248,7 +247,7 @@ namespace Batch {
 
     int status = system(command.c_str());
     if (status)
-      throw EmulationException("Can't delete job " + jobid.getReference());
+      throw RunTimeException("Can't delete job " + jobid.getReference());
 
     cerr << "job " << jobid.getReference() << " killed" << endl;
   }
@@ -291,7 +290,7 @@ namespace Batch {
     string output;
     int status = Utils::getCommandOutput(command, output);
     if (status != 0)
-      throw EmulationException("Can't query job " + jobid.getReference());
+      throw RunTimeException("Can't query job " + jobid.getReference());
     JobInfo_eVishnu jobinfo = JobInfo_eVishnu(jobid.getReference(), output);
     return jobinfo;
   }
@@ -310,7 +309,7 @@ namespace Batch {
     string absdir = (Utils::isAbsolutePath(directory))? directory : cwd + "/" + directory;
     int status = CommunicationProtocol::getInstance(SH).makeDirectory(absdir, "", "");
     if (status != 0) {
-      throw EmulationException("Can't create result directory");
+      throw RunTimeException("Can't create result directory");
     }
 
     string subCommand = string("export OMNIORB_CONFIG=$VISHNU_CONFIG_FILE; ");
@@ -347,7 +346,7 @@ namespace Batch {
     status = Utils::getCommandOutput(command, output);
     cout << output;
     if (status != 0)
-      throw EmulationException("Can't import output files, error was: " + output);
+      throw RunTimeException("Can't import output files, error was: " + output);
   }
 
 }