Back to index

salome-kernel  6.5.0
Launcher_Job_YACSFile.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2009-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // Author: André RIBES - EDF R&D
00021 //
00022 #include "Launcher_Job_YACSFile.hxx"
00023 #include <sstream>
00024 
00025 
00026 Launcher::Job_YACSFile::Job_YACSFile() 
00027 {
00028   _job_type = "yacs_file";
00029   _dumpState = -1;
00030 }
00031 
00032 Launcher::Job_YACSFile::~Job_YACSFile() {}
00033 
00034 void 
00035 Launcher::Job_YACSFile::setJobFile(const std::string & job_file)
00036 {
00037   Launcher::Job::setJobFile(job_file);
00038 }
00039 
00040 void
00041 Launcher::Job_YACSFile::addJobTypeSpecificScript(std::ofstream & launch_script_stream)
00042 {
00043   launch_script_stream << _resource_definition.AppliPath << "/runSession -p $appli_port driver -k $appli_port " << _job_file_name_complete;
00044   if (_dumpState > 0)
00045     launch_script_stream << " --dump=" << _dumpState;
00046   launch_script_stream << " > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl;
00047 }
00048 
00049 void
00050 Launcher::Job_YACSFile::checkSpecificParameters()
00051 {
00052   // Specific parameters
00053   std::map<std::string, std::string>::iterator it = _specific_parameters.find("EnableDumpYACS");
00054   if (it != _specific_parameters.end())
00055   {
00056     // Decode info
00057     std::string user_value = it->second;
00058     std::istringstream iss(user_value);
00059     if (!(iss >> _dumpState))
00060       throw LauncherException("Specific parameter EnableDumpYACS is not correctly defined: it should be an integer. Value given is " + user_value);
00061   }
00062 }