From 06bb2abac53367ce60ed64f665d4713ee2f36f16 Mon Sep 17 00:00:00 2001 From: ribes Date: Thu, 3 Dec 2009 16:02:40 +0000 Subject: [PATCH] - YACSFile jobs and PythonSALOME jobs can choose their files extensions --- src/Launcher/Launcher_Job.cxx | 3 +++ src/Launcher/Launcher_Job.hxx | 2 ++ src/Launcher/Launcher_Job_Command.cxx | 3 +-- src/Launcher/Launcher_Job_PythonSALOME.cxx | 2 +- src/Launcher/Launcher_Job_YACSFile.cxx | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 69f2bd32d..7c03ec648 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -30,6 +30,7 @@ Launcher::Job::Job() _env_file = ""; _job_file = ""; _job_file_name = ""; + _job_file_name_complete = ""; _work_directory = ""; _local_directory = ""; _result_directory = ""; @@ -146,7 +147,9 @@ Launcher::Job::setJobFile(const std::string & job_file) _job_file = job_file; std::string::size_type p1 = _job_file.find_last_of("/"); std::string::size_type p2 = _job_file.find_last_of("."); + _job_file_name_complete = _job_file.substr(p1+1); _job_file_name = _job_file.substr(p1+1,p2-p1-1); + if (_job_file != "") add_in_file(_job_file); } diff --git a/src/Launcher/Launcher_Job.hxx b/src/Launcher/Launcher_Job.hxx index 12686a5be..ee949ea9b 100644 --- a/src/Launcher/Launcher_Job.hxx +++ b/src/Launcher/Launcher_Job.hxx @@ -108,6 +108,8 @@ namespace Launcher std::string _job_file; std::string _job_file_name; + std::string _job_file_name_complete; + std::string _work_directory; std::string _local_directory; std::string _result_directory; diff --git a/src/Launcher/Launcher_Job_Command.cxx b/src/Launcher/Launcher_Job_Command.cxx index 38a5330e2..313a0b026 100644 --- a/src/Launcher/Launcher_Job_Command.cxx +++ b/src/Launcher/Launcher_Job_Command.cxx @@ -43,7 +43,6 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l // File name std::string::size_type p1 = _job_file.find_last_of("/"); - std::string command_file_name = _job_file.substr(p1+1); std::string launch_date_port_file = launch_date; std::string launch_script = "/tmp/runCommand_" + _job_file_name + "_" + launch_date + ".sh"; @@ -58,7 +57,7 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l std::string::size_type last = _env_file.find_last_of("/"); launch_script_stream << "source ./" << _env_file.substr(last+1) << std::endl; } - launch_script_stream << "./" << command_file_name << " > " << work_directory <<"/logs/command_" << launch_date << ".log 2>&1" << std::endl; + launch_script_stream << "./" << _job_file_name_complete << " > " << work_directory <<"/logs/command_" << launch_date << ".log 2>&1" << std::endl; // Return launch_script_stream.flush(); diff --git a/src/Launcher/Launcher_Job_PythonSALOME.cxx b/src/Launcher/Launcher_Job_PythonSALOME.cxx index 219bfd70a..6fcffb68d 100644 --- a/src/Launcher/Launcher_Job_PythonSALOME.cxx +++ b/src/Launcher/Launcher_Job_PythonSALOME.cxx @@ -35,7 +35,7 @@ Launcher::Job_PythonSALOME::setJobFile(const std::string & job_file) void Launcher::Job_PythonSALOME::addJobTypeSpecificScript(std::ofstream & launch_script_stream) { - launch_script_stream << _machine_definition.AppliPath << "/runSession -p $appli_port python " << _job_file_name << ".py > logs/python_" << _launch_date << ".log 2>&1" << std::endl; + launch_script_stream << _machine_definition.AppliPath << "/runSession -p $appli_port python " << _job_file_name_complete << " > logs/python_" << _launch_date << ".log 2>&1" << std::endl; } #endif diff --git a/src/Launcher/Launcher_Job_YACSFile.cxx b/src/Launcher/Launcher_Job_YACSFile.cxx index 42cbf9a21..daf6b331e 100644 --- a/src/Launcher/Launcher_Job_YACSFile.cxx +++ b/src/Launcher/Launcher_Job_YACSFile.cxx @@ -34,5 +34,5 @@ Launcher::Job_YACSFile::setJobFile(const std::string & job_file) void Launcher::Job_YACSFile::addJobTypeSpecificScript(std::ofstream & launch_script_stream) { - launch_script_stream << _machine_definition.AppliPath << "/runSession -p $appli_port driver " << _job_file_name << ".xml > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl; + launch_script_stream << _machine_definition.AppliPath << "/runSession -p $appli_port driver " << _job_file_name_complete << " > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl; } -- 2.39.2