the stuff to run the job. Note that the job will be executed from within
this directory. A change directory toward this working directory is done
by the batch system before running the job.
+ If not specified (empty string), the launcher will use the working
+ directory of the chosen ressource and if this is also an empty string
+ the value used will be $HOME/Batch/workdir_"date" where $HOME is the
+ value of the environment variable on the remote ressource and "date" is
+ the current date.
*/
string work_directory;
//! Local directory where to get result files.
/*! It must be used to specify where to download the output files on the
local file system.
+ If not specified (empty string), the value of $HOME environment variable
+ will be used.
\see SalomeLauncher::getJobResults
*/
string result_directory;
// Author: André RIBES - EDF R&D
//
+//#define _DEBUG_
#include "Launcher_Job.hxx"
#include "Launcher.hxx"
params[Batch::MEMPERCPU] = (long)_mem_per_cpu;
}
- // We define a default directory based on user time
+ // We define a default directory
if (_work_directory == "")
{
- const size_t BUFSIZE = 32;
- char date[BUFSIZE];
- time_t curtime = time(NULL);
- strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime));
- _work_directory = std::string("$HOME/Batch/workdir_");
- _work_directory += date;
+ if(!_resource_definition.working_directory.empty())
+ {
+ _work_directory = _resource_definition.working_directory;
+ }
+ else
+ {
+ const size_t BUFSIZE = 32;
+ char date[BUFSIZE];
+ time_t curtime = time(NULL);
+ strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime));
+ _work_directory = std::string("/$HOME/Batch/workdir_");
+ _work_directory += date;
+ }
}
params[Batch::WORKDIR] = _work_directory;
#ifndef WIN32
local_file = _local_directory + "/" + file;
#else
- local_file = file;
+ local_file = file;
#endif
// remote file -> get only file name from in_files