]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
debug batch job command from xml file
authorsecher <secher>
Wed, 13 Jan 2010 13:10:16 +0000 (13:10 +0000)
committersecher <secher>
Wed, 13 Jan 2010 13:10:16 +0000 (13:10 +0000)
src/Launcher/Launcher.cxx
src/Launcher/Makefile.am

index e28a96100fdf317c96fe1796d276e2c22157a0c9..f2f97aa52076d10ad78e5b3b3fd266aa857b3769 100644 (file)
@@ -29,6 +29,8 @@
 #include <Batch/Batch_FactBatchManager_eSSH.hxx>
 #endif
 
+#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
 #include "SALOME_Launcher_Handler.hxx"
 #include "Launcher.hxx"
 #include "Launcher_Job_Command.hxx"
@@ -304,7 +306,20 @@ Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile,
 
   // Creating a new job
   Launcher::Job_Command * new_job = new Launcher::Job_Command();
-  new_job->setJobFile(job_params.Command);
+
+  string cmdFile = Kernel_Utils::GetTmpFileName();  
+#ifndef WIN32
+  cmdFile += ".sh";
+#else
+  cmdFile += ".bat";
+#endif
+  ofstream os;
+  os.open(cmdFile.c_str(), ofstream::out );
+  os << "#! /bin/sh" << endl;
+  os << job_params.Command;
+  os.close();
+
+  new_job->setJobFile(cmdFile);
   new_job->setLocalDirectory(job_params.RefDirectory);
   new_job->setWorkDirectory(job_params.MachinesList[clusterName].WorkDirectory);
   new_job->setEnvFile(job_params.MachinesList[clusterName].EnvFile);
@@ -316,7 +331,13 @@ Launcher_cpp::createJobWithFile(const std::string xmlExecuteFile,
 
   resourceParams p;
   p.hostname = clusterName;
+  p.name = "";
+  p.OS = "";
   p.nb_proc = job_params.NbOfProcesses;
+  p.nb_node = 0;
+  p.nb_proc_per_node = 0;
+  p.cpu_clock = 0;
+  p.mem_mb = 0;
   new_job->setResourceRequiredParams(p);
 
   createJob(new_job);
index ab11e0daff57234c5ff9f338860b376a48803d2a..87dd1c923f21135f8d855daa1a3d5e40a35b5ecb 100644 (file)
@@ -127,6 +127,7 @@ libLauncher_la_SOURCES=\
        Launcher.cxx
 
 libLauncher_la_CPPFLAGS =\
+       -I$(srcdir)/../Basics \
        -I$(srcdir)/../ResourcesManager \
        @LIBBATCH_INCLUDES@ \
        @MPI_INCLUDES@ \