]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Use constants in namespace Batch in libBatch. Warning: this change will break Kernel...
authorbarate <barate>
Tue, 26 Jan 2010 10:40:53 +0000 (10:40 +0000)
committerbarate <barate>
Tue, 26 Jan 2010 10:40:53 +0000 (10:40 +0000)
src/Launcher/Launcher_Job.cxx
src/Launcher/Launcher_Job_Command.cxx
src/Launcher/Launcher_Job_SALOME.cxx

index 51f5d18cd7f253a0a130807b136dfc19efb7e52c..286892386bd82a4d4428079bad5a0c6633be74ed 100644 (file)
@@ -374,7 +374,7 @@ Launcher::Job::updateJobState()
     Batch::JobInfo job_info = _batch_job_id.queryJob();
     Batch::Parametre par = job_info.getParametre();
 
-    LAUNCHER_MESSAGE("State received is: " << par[STATE].str());
+    LAUNCHER_MESSAGE("State received is: " << par[Batch::STATE].str());
 
     // TODO: Remove this if all tests pass with the new libBatch, otherwise fix the codes in libBatch
     // Patch until new LIBBATCH version
@@ -389,7 +389,7 @@ Launcher::Job::updateJobState()
       _state = "ERROR";
     else if (par[STATE].str() == "Q" or par[STATE].str() == "qw" or par[STATE].str() == "PEN")
       _state = "QUEUED";*/
-    _state = par[STATE].str();
+    _state = par[Batch::STATE].str();
   }
 #endif
   return _state;
@@ -408,14 +408,14 @@ Launcher::Job::common_job_params()
 {
   Batch::Parametre params;
 
-  params[USER] = _resource_definition.UserName;
-  params[NBPROC] = _resource_required_params.nb_proc;
+  params[Batch::USER] = _resource_definition.UserName;
+  params[Batch::NBPROC] = _resource_required_params.nb_proc;
 
   // Memory
   if (_resource_required_params.mem_mb > 0)
   {
     // Memory is in kilobytes
-    params[MAXRAMSIZE] = _resource_required_params.mem_mb * 1024;
+    params[Batch::MAXRAMSIZE] = _resource_required_params.mem_mb * 1024;
   }
 
   // We define a default directory based on user time
@@ -435,8 +435,8 @@ Launcher::Job::common_job_params()
     _work_directory = std::string("$HOME/Batch/");
     _work_directory += thedate;
   }
-  params[WORKDIR] = _work_directory;
-  params[TMPDIR] = _work_directory; // To Compatibility -- remove ??? TODO
+  params[Batch::WORKDIR] = _work_directory;
+  params[Batch::TMPDIR] = _work_directory; // To Compatibility -- remove ??? TODO
 
   // If result_directory is not defined, we use HOME environnement
   if (_result_directory == "")
@@ -458,7 +458,7 @@ Launcher::Job::common_job_params()
     size_t found = file.find_last_of("/");
     std::string remote_file = _work_directory + "/" + file.substr(found+1);
 
-    params[INFILE] += Batch::Couple(local_file, remote_file);
+    params[Batch::INFILE] += Batch::Couple(local_file, remote_file);
   }
    
   // _out_files
@@ -477,16 +477,16 @@ Launcher::Job::common_job_params()
     else
       remote_file = _work_directory + "/" + file;
 
-    params[OUTFILE] += Batch::Couple(local_file, remote_file);
+    params[Batch::OUTFILE] += Batch::Couple(local_file, remote_file);
   }
 
   // Time
   if (_maximum_duration_in_second != -1)
-    params[MAXWALLTIME] = _maximum_duration_in_second;
+    params[Batch::MAXWALLTIME] = _maximum_duration_in_second;
 
   // Queue
   if (_queue != "")
-    params[QUEUE] = _queue;
+    params[Batch::QUEUE] = _queue;
 
   return params;
 }
index fa33a2363d1d535b7d0d2cd2b9dd277c02277569..deec854b678bfc7935192b8335a2690d7cd6d10c 100644 (file)
@@ -29,7 +29,7 @@ Launcher::Job_Command::update_job()
 {
 #ifdef WITH_LIBBATCH
   Batch::Parametre params = common_job_params();
-  params[EXECUTABLE] = buildCommandScript(params, _launch_date);
+  params[Batch::EXECUTABLE] = buildCommandScript(params, _launch_date);
   _batch_job->setParametre(params);
 #endif
 }
@@ -39,7 +39,7 @@ std::string
 Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string launch_date)
 {
   // parameters
-  std::string work_directory = params[WORKDIR].str();
+  std::string work_directory = params[Batch::WORKDIR].str();
 
   // File name
   std::string launch_date_port_file = launch_date;
index 0555a38072d0bb6f7617156bb47d409d2e2d2bbd..b634499307004e73bf5d1cd48574028345997b58 100644 (file)
@@ -41,7 +41,7 @@ Launcher::Job_SALOME::update_job()
 {
 #ifdef WITH_LIBBATCH
   Batch::Parametre params = common_job_params();
-  params[EXECUTABLE] = buildSalomeScript(params);
+  params[Batch::EXECUTABLE] = buildSalomeScript(params);
   _batch_job->setParametre(params);
 #endif
 }
@@ -51,7 +51,7 @@ std::string
 Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params)
 {
   // parameters
-  std::string work_directory = params[WORKDIR].str();
+  std::string work_directory = params[Batch::WORKDIR].str();
 
   std::string launch_date_port_file = _launch_date;
   std::string launch_script = "/tmp/runSalome_" + _job_file_name + "_" + _launch_date + ".sh";