]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
You can now add options to the "driver" command of a YACS job.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 15 Mar 2016 10:02:25 +0000 (11:02 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Tue, 15 Mar 2016 10:02:25 +0000 (11:02 +0100)
src/engine/BL_Job.cxx
src/engine/BL_Job.hxx
src/engine/BL_SALOMEServices.cxx
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/BL_JobsManager_QT.cxx

index 1f91cec3d34b5ca0a1c87cf46185f5030d555b52..3f073586aefbbd188b67dab086b149d089a49ce7 100644 (file)
@@ -39,6 +39,7 @@ BL::Job::Job()
   _thread_state = BL::Job::NOTHING;
   _salome_launcher_id = -1;
   _dump_yacs_state = 0;
+  _yacs_driver_options = "";
   _ll_jobtype = "";
 
   // Parameters for COORM
@@ -66,6 +67,7 @@ BL::Job::Job(const std::string & name)
   _thread_state = BL::Job::NOTHING;
   _salome_launcher_id = -1;
   _dump_yacs_state = 0;
+  _yacs_driver_options = "";
   _ll_jobtype = "";
 
   // Parameters for COORM
@@ -129,6 +131,18 @@ BL::Job::getDumpYACSState()
   return _dump_yacs_state;
 }
 
+void
+BL::Job::setYacsDriverOptions(const std::string& options)
+{
+  _yacs_driver_options = options;
+}
+
+const std::string&
+BL::Job::getYacsDriverOptions()const
+{
+  return _yacs_driver_options;
+}
+
 void 
 BL::Job::setJobFile(const std::string & job_file)
 {
index 417e0c45c04b1c1ae28f3c621dfc44b597bd7d0b..db7a8aee7fb1c4e61f143f6161c480bb8bebf7ba 100644 (file)
@@ -56,6 +56,9 @@ namespace BL{
       void setDumpYACSState(const int & dump_yacs_state);
       int getDumpYACSState();
 
+      void setYacsDriverOptions(const std::string& options);
+      const std::string& getYacsDriverOptions()const;
+
       enum MemReqType {MEM_PER_NODE, MEM_PER_CPU};
 
       struct BatchParam
@@ -114,6 +117,7 @@ namespace BL{
       BL::Job::State _state;
       BL::Job::ThreadState _thread_state;
       int _dump_yacs_state;
+      std::string _yacs_driver_options;
 
       std::string _name;
 
index 4ac6b3a82bdd60ee902ec6f7798c0d71d3f25a13..0269492ef7cea654bbd8803810ae8a7a0a611171 100644 (file)
@@ -277,6 +277,14 @@ BL::SALOMEServices::create_job(BL::Job * job)
       new_parameter->value = CORBA::string_dup(oss.str().c_str());
       job_parameters->specific_parameters[job_parameters->specific_parameters.length() - 1] = new_parameter;
     }
+    if (not job->getYacsDriverOptions().empty())
+    {
+      job_parameters->specific_parameters.length(job_parameters->specific_parameters.length() + 1);
+      Engines::Parameter_var new_parameter = new Engines::Parameter;
+      new_parameter->name = CORBA::string_dup("YACSDriverOptions");
+      new_parameter->value = CORBA::string_dup(job->getYacsDriverOptions().c_str());
+      job_parameters->specific_parameters[job_parameters->specific_parameters.length() - 1] = new_parameter;
+    }
   }
   if (job->getLoadLevelerJobType() != "")
   {
@@ -670,6 +678,11 @@ BL::SALOMEServices::get_new_job(int job_number)
         iss >> value;
         job_return->setDumpYACSState(value);
       }
+      if (std::string(job_parameters->specific_parameters[i].name.in()) == "YACSDriverOptions")
+      {
+        std::string user_value = job_parameters->specific_parameters[i].value.in();
+        job_return->setYacsDriverOptions(user_value);
+      }
       if (std::string(job_parameters->specific_parameters[i].name.in()) == "LoalLevelerJobType")
       {
         std::string user_value = job_parameters->specific_parameters[i].value.in();
index 3006ceee018e784f37ba237e6f29e33eac479b92..83d2dc697b51721eed2ece030107983747c69c2e 100644 (file)
@@ -77,6 +77,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO
 
   start_job = false;
   dump_yacs_state = -1;
+  yacs_driver_options = "";
   ll_jobtype = "";
 
   setOptions(QWizard::NoBackButtonOnStartPage);
@@ -138,6 +139,10 @@ BL::CreateJobWizard::clone(const std::string & name)
         value.setNum(job->getDumpYACSState());
         setField("dump_yacs_state", value);
       }
+      if (not job->getYacsDriverOptions().empty())
+      {
+        setField("yacs_driver_options", job->getYacsDriverOptions().c_str());
+      }
     }
     else if (job->getType() == BL::Job::COMMAND)
     {
@@ -263,6 +268,7 @@ BL::CreateJobWizard::end(int result)
     QString f_yacs_file = field("yacs_file").toString();
     yacs_file = f_yacs_file.trimmed().toUtf8().constData();
     dump_yacs_state = field("dump_yacs_state").toInt();
+    yacs_driver_options = field("yacs_driver_options").toString().trimmed().toUtf8().constData();
 
     // Command Panel
     QString f_command = field("command").toString();
@@ -558,15 +564,18 @@ BL::YACSSchemaPage::YACSSchemaPage(QWidget * parent)
 
   QGroupBox * spec_param_box = new QGroupBox("YACS specific parameters");
   QLabel * label_dump =  new QLabel("Dump YACS state each secs (0 disable this feature)");
-  QLabel * label_dump_warning = new QLabel("(WARNING: can only be used with SALOME >= 6.3.0)");
+  QLabel * label_driver_options = new QLabel("YACS driver options - see YACS driver documentation.");
   QSpinBox * spin_dump = new QSpinBox(this);
   spin_dump->setMinimum(0);
   spin_dump->setMaximum(1000000);
   registerField("dump_yacs_state", spin_dump);
+  QLineEdit* edit_yacs_driver_options = new QLineEdit(this);
+  registerField("yacs_driver_options", edit_yacs_driver_options);
   QGridLayout * specific_layout = new QGridLayout;
   specific_layout->addWidget(label_dump, 0, 0);
   specific_layout->addWidget(spin_dump, 0, 1);
-  specific_layout->addWidget(label_dump_warning, 1, 0);
+  specific_layout->addWidget(label_driver_options, 1, 0);
+  specific_layout->addWidget(edit_yacs_driver_options, 1, 1);
   spec_param_box->setLayout(specific_layout);
 
   QVBoxLayout * main_layout = new QVBoxLayout;
index 624577318f2f56fd79f86449d86fa70bab49936c..e658d2499de3d9fae3e27431e0ce2e7bc74e0cf2 100644 (file)
@@ -107,6 +107,7 @@ namespace BL {
       bool start_job;
       int dump_yacs_state;
       std::string ll_jobtype;
+      std::string yacs_driver_options;
 
     public:
       enum {Page_JobName,
index 4b20741775ad4099442d29d50b849a821b1ca4cb..42f82ea2cd7acd69eb082c590c56a7c0ab815855 100644 (file)
@@ -291,6 +291,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
     new_job->setType(BL::Job::YACS_SCHEMA);
     new_job->setJobFile(wizard.yacs_file);
     new_job->setDumpYACSState(wizard.dump_yacs_state);
+    new_job->setYacsDriverOptions(wizard.yacs_driver_options);
     break;
   case BL::CreateJobWizard::COMMAND:
     // Command Job