From fd9a7ef0210c691be321c86e72de748c3739d577 Mon Sep 17 00:00:00 2001 From: secher Date: Wed, 13 Jan 2010 13:10:16 +0000 Subject: [PATCH] debug batch job command from xml file --- src/Launcher/Launcher.cxx | 23 ++++++++++++++++++++++- src/Launcher/Makefile.am | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Launcher/Launcher.cxx b/src/Launcher/Launcher.cxx index e28a96100..f2f97aa52 100644 --- a/src/Launcher/Launcher.cxx +++ b/src/Launcher/Launcher.cxx @@ -29,6 +29,8 @@ #include #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); diff --git a/src/Launcher/Makefile.am b/src/Launcher/Makefile.am index ab11e0daf..87dd1c923 100644 --- a/src/Launcher/Makefile.am +++ b/src/Launcher/Makefile.am @@ -127,6 +127,7 @@ libLauncher_la_SOURCES=\ Launcher.cxx libLauncher_la_CPPFLAGS =\ + -I$(srcdir)/../Basics \ -I$(srcdir)/../ResourcesManager \ @LIBBATCH_INCLUDES@ \ @MPI_INCLUDES@ \ -- 2.39.2