]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
the dump state for batch of yacs file is optional
authorsecher <secher>
Tue, 22 Feb 2011 10:37:39 +0000 (10:37 +0000)
committersecher <secher>
Tue, 22 Feb 2011 10:37:39 +0000 (10:37 +0000)
src/Launcher/Launcher_Job_YACSFile.cxx
src/Launcher/Launcher_Job_YACSFile.hxx
src/Launcher/SALOME_Launcher.cxx

index 1f420f1aaa83fd02388456f4fc24c3d302576354..31bd4fe14f6348fee9ae897953b953ec062aa99d 100644 (file)
@@ -22,7 +22,7 @@
 #include "Launcher_Job_YACSFile.hxx"
 
 
-Launcher::Job_YACSFile::Job_YACSFile() {_job_type = "yacs_file";}
+Launcher::Job_YACSFile::Job_YACSFile() {_job_type = "yacs_file"; _dumpState=0;}
 
 Launcher::Job_YACSFile::~Job_YACSFile() {}
 
@@ -35,5 +35,14 @@ Launcher::Job_YACSFile::setJobFile(const std::string & job_file)
 void
 Launcher::Job_YACSFile::addJobTypeSpecificScript(std::ofstream & launch_script_stream)
 {
-  launch_script_stream << _resource_definition.AppliPath << "/runSession -p $appli_port driver " << _job_file_name_complete << " --dump=30 > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl;
+  launch_script_stream << _resource_definition.AppliPath << "/runSession -p $appli_port driver " << _job_file_name_complete;
+  if(_dumpState > 0)
+    launch_script_stream << " --dump=" << _dumpState;
+  launch_script_stream << " > logs/yacs_" << _launch_date << ".log 2>&1" << std::endl;
+}
+
+void
+Launcher::Job_YACSFile::setDumpState(const int dumpState)
+{
+  _dumpState = dumpState;
 }
index 371726f202750e9829da06e90df8389bdb3b19e7..e6226afcf1913a2627461d08a3b3ee4a8941d657 100644 (file)
@@ -34,6 +34,9 @@ namespace Launcher
 
       virtual void setJobFile(const std::string & job_file);
       virtual void addJobTypeSpecificScript(std::ofstream & launch_script_stream);
+      virtual void setDumpState(const int dumpState);
+    protected:
+      int _dumpState;
   };
 }
 
index abf1e2389eabd88565588e78d07dbc6cc1ed0e19..379f681b7e85658998fd5afd3cd93db9d86aa784 100644 (file)
@@ -170,6 +170,14 @@ SALOME_Launcher::createJob(const Engines::JobParameters & job_parameters)
     THROW_SALOME_CORBA_EXCEPTION(ex.msg.c_str(),SALOME::INTERNAL_ERROR);
   }
 
+  for(int i=0;i<job_parameters.specific_parameters.length();i++){
+    std::string option = CORBA::string_dup(job_parameters.specific_parameters[i].name);
+    if(option.find("EnableDumpYACS") != std::string::npos){
+      int dumpState = atoi(job_parameters.specific_parameters[i].value);
+      (dynamic_cast<Launcher::Job_YACSFile *>(new_job))->setDumpState(dumpState);
+    }
+  }
+
   try
   {
     _l.createJob(new_job);