From c34a81da54bd2d0515d9d72dce24037bad3df915 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 8 Oct 2012 08:45:23 +0000 Subject: [PATCH] Patrial fix of the issue 21727: [CEA 584] sending a Yacs graph from Windows to a cluster --- src/Launcher/Launcher_Job.cxx | 4 ++++ src/Launcher/Launcher_Job_Command.cxx | 3 ++- src/Launcher/Launcher_Job_SALOME.cxx | 10 ++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index ae7d4814e..1307fbf22 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -502,7 +502,11 @@ Launcher::Job::common_job_params() if (file.substr(0, 1) == std::string("/")) local_file = file; else +#ifndef WIN32 local_file = _local_directory + "/" + file; +#else + local_file = file; +#endif // remote file -> get only file name from in_files size_t found = file.find_last_of("/"); diff --git a/src/Launcher/Launcher_Job_Command.cxx b/src/Launcher/Launcher_Job_Command.cxx index f325898ed..6f2fecebd 100644 --- a/src/Launcher/Launcher_Job_Command.cxx +++ b/src/Launcher/Launcher_Job_Command.cxx @@ -20,6 +20,7 @@ // Author: André RIBES - EDF R&D // #include "Launcher_Job_Command.hxx" +#include "Basics_DirUtils.hxx" #ifdef WITH_LIBBATCH #include @@ -54,7 +55,7 @@ Launcher::Job_Command::buildCommandScript(Batch::Parametre params, std::string l // File name std::string launch_date_port_file = launch_date; - std::string launch_script = "/tmp/runCommand_" + _job_file_name + "_" + launch_date + ".sh"; + std::string launch_script = Kernel_Utils::GetTmpDir() + "runCommand_" + _job_file_name + "_" + launch_date + ".sh"; std::ofstream launch_script_stream; launch_script_stream.open(launch_script.c_str(), std::ofstream::out); diff --git a/src/Launcher/Launcher_Job_SALOME.cxx b/src/Launcher/Launcher_Job_SALOME.cxx index 5e80649d0..85f6e1015 100644 --- a/src/Launcher/Launcher_Job_SALOME.cxx +++ b/src/Launcher/Launcher_Job_SALOME.cxx @@ -20,6 +20,7 @@ // Author: André RIBES - EDF R&D // #include "Launcher_Job_SALOME.hxx" +#include "Basics_DirUtils.hxx" #ifdef WITH_LIBBATCH #include @@ -64,9 +65,14 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params) // parameters std::string work_directory = params[Batch::WORKDIR].str(); - std::string launch_script = "/tmp/runSalome_" + _job_file_name + "_" + _launch_date + ".sh"; + std::string launch_script = Kernel_Utils::GetTmpDir() + "runSalome_" + _job_file_name + "_" + _launch_date + ".sh"; std::ofstream launch_script_stream; - launch_script_stream.open(launch_script.c_str(), std::ofstream::out); + launch_script_stream.open(launch_script.c_str(), + std::ofstream::out +#ifdef WIN32 + | std::ofstream::binary //rnv: to avoid CL+RF end of line on windows +#endif + ); // Begin of script launch_script_stream << "#!/bin/sh -f" << std::endl; -- 2.39.2