-// Copyright (C) 2009-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2009-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
#include "Launcher_Job_YACSFile.hxx"
#include <sstream>
+#include <sys/stat.h>
+const char Launcher::Job_YACSFile::TYPE_NAME[] = "yacs_file";
Launcher::Job_YACSFile::Job_YACSFile()
{
- _job_type = "yacs_file";
+ _job_type = Launcher::Job_YACSFile::TYPE_NAME;
_dumpState = -1;
_yacsDriverOptions = "";
}
void
Launcher::Job_YACSFile::addJobTypeSpecificScript(std::ofstream & launch_script_stream)
{
- launch_script_stream << _resource_definition.AppliPath << "/salome shell -p \"$appli_port\" -- driver -k\"$appli_port\" " << _job_file_name_complete;
+ struct stat statbuf;
+ if(stat(getenv("APPLI"), &statbuf) ==0 && S_ISREG(statbuf.st_mode))
+ // case of a salome launcher file
+ launch_script_stream << _resource_definition.AppliPath << " shell -p \"$appli_port\" -- driver -k\"$appli_port\" " << _job_file_name_complete;
+ else
+ launch_script_stream << _resource_definition.AppliPath << "/salome shell -p \"$appli_port\" -- driver -k\"$appli_port\" " << _job_file_name_complete;
if (_dumpState > 0)
launch_script_stream << " --dump=" << _dumpState;
- if(not _yacsDriverOptions.empty())
+ if(! _yacsDriverOptions.empty())
launch_script_stream << " " << _yacsDriverOptions ;
launch_script_stream << " > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl;
}