]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Add possibility to specify extra parameters in the job submission file rbe/evol-job-newparams
authorRenaud Barate <renaud.barate@edf.fr>
Tue, 7 Oct 2014 15:28:14 +0000 (17:28 +0200)
committerRenaud Barate <renaud.barate@edf.fr>
Tue, 7 Oct 2014 15:28:14 +0000 (17:28 +0200)
src/engine/BL_Job.cxx
src/engine/BL_Job.hxx
src/engine/BL_SALOMEServices.cxx
src/genericgui/AdvancedParametersWizardPage.ui
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_CreateJobWizard.hxx
src/genericgui/BL_JobsManager_QT.cxx

index 6f7886b9b530e2b1301546bcd3c2a2d65d826cd9..316360b8744462b309f716f54611095185c61559 100644 (file)
@@ -215,6 +215,18 @@ BL::Job::getWCKey()
   return _wckey;
 }
 
+void
+BL::Job::setExtraParams(const std::string & extra_params)
+{
+  _extra_params = extra_params;
+}
+
+const std::string &
+BL::Job::getExtraParams()
+{
+  return _extra_params;
+}
+
 void
 BL::Job::setLoadLevelerJobType(const std::string & jobtype)
 {
index 646949a550ed7bc3d04ce3b0c54e965292f464eb..26e81fc07a4c6efb30d015be2c876b79bf88b362 100644 (file)
@@ -92,6 +92,9 @@ namespace BL{
       void setWCKey(const std::string & wckey);
       const std::string & getWCKey();
 
+      void setExtraParams(const std::string & extra_params);
+      const std::string & getExtraParams();
+
       void setLoadLevelerJobType(const std::string & jobtype);
       std::string & getLoadLevelerJobType();
 
@@ -123,6 +126,7 @@ namespace BL{
       std::string _resource_choosed;
       std::string _batch_queue;
       std::string _wckey;
+      std::string _extra_params;
       std::string _ll_jobtype;
 
       int _salome_launcher_id;
index c5c1129309b4ad1cb2e3602dd5778e84a779e398..e0d68acd2aede6a018c5c9c2eb17d3886a2cd26b 100644 (file)
@@ -322,6 +322,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
   job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str());
   job_parameters->exclusive = cpp_batch_params.exclusive;
   job_parameters->wckey = CORBA::string_dup(job->getWCKey().c_str());
+  job_parameters->extra_params = CORBA::string_dup(job->getExtraParams().c_str());
 
   // Memory
   switch (cpp_batch_params.mem_req_type)
@@ -623,6 +624,7 @@ BL::SALOMEServices::get_new_job(int job_number)
     job_return->setEnvFile(job_parameters->env_file.in());
     job_return->setBatchQueue(job_parameters->queue.in());
     job_return->setWCKey(job_parameters->wckey.in());
+    job_return->setExtraParams(job_parameters->extra_params.in());
 
     BL::Job::FilesParam param;
     param.result_directory = job_parameters->result_directory.in();
index ca0941128eeda20e138c9de1aab49574a0ca2982..6509720e79a47ad4f17e8e41302899bb2e16b106 100644 (file)
@@ -2,20 +2,70 @@
 <ui version="4.0">
  <class>AdvancedParametersWizardPage</class>
  <widget class="QWizardPage" name="AdvancedParametersWizardPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>589</width>
+    <height>441</height>
+   </rect>
+  </property>
   <property name="title">
    <string>Advanced Parameters</string>
   </property>
-  <layout class="QFormLayout" name="formLayout">
-   <item row="0" column="0">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string>Workload Characterization Key (wckey):</string>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <layout class="QFormLayout" name="formLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label">
+       <property name="text">
+        <string>Workload Characterization Key (wckey):</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QLineEdit" name="line_wckey"/>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Extra parameters</string>
      </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <widget class="QLabel" name="label_3">
+        <property name="text">
+         <string>&lt;html&gt;
+&lt;head&gt;
+&lt;style type=&quot;text/css&quot;&gt;
+.code{font-family: monospace}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;The following text will be added &amp;quot;as is&amp;quot; in the job submission file. It can be used to specify parameters that are not available through the JobManager interface or to define environment variables for the job.&lt;/p&gt;
+&lt;p&gt;Example:&lt;/p&gt;
+&lt;div class=&quot;code&quot;&gt;#MSUB -@ jonathan.xxx@cea.fr:begin,end&lt;br/&gt;
+export OMPI_MCA_orte_process_binding=none&lt;br/&gt;
+...&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</string>
+        </property>
+        <property name="wordWrap">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPlainTextEdit" name="text_extra_params">
+        <property name="font">
+         <font>
+          <family>Monospace</family>
+         </font>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
-   <item row="0" column="1">
-    <widget class="QLineEdit" name="line_wckey"/>
-   </item>
   </layout>
  </widget>
  <resources/>
index 353704b2b5bda1fd780abc66fe7157228bd23cdd..9d9ea3c0a745673c2fd0d1add51e1771e5625660 100644 (file)
@@ -227,6 +227,7 @@ BL::CreateJobWizard::clone(const std::string & name)
     setField("batch_queue", QString(job->getBatchQueue().c_str()));
     setField("ll_jobtype", QString(job->getLoadLevelerJobType().c_str()));
     setField("wckey", QString(job->getWCKey().c_str()));
+    setField("extra_params", QString(job->getExtraParams().c_str()));
   }
 }
 
@@ -369,6 +370,10 @@ BL::CreateJobWizard::end(int result)
     QString f_wckey = field("wckey").toString();
     wckey = f_wckey.trimmed().toUtf8().constData();
 
+    // Extra params
+    QString f_extra_params = field("extra_params").toString();
+    extra_params = f_extra_params.trimmed().toUtf8().constData();
+
     start_job = field("start_job").toBool();
   }
 }
@@ -1340,6 +1345,7 @@ AdvancedParametersPage::AdvancedParametersPage(CreateJobWizard * parent)
 {
   ui->setupUi(this);
   registerField("wckey", ui->line_wckey);
+  registerField("extra_params", ui->text_extra_params, "plainText", "textChanged()");
 };
 
 AdvancedParametersPage::~AdvancedParametersPage()
index 757f2193fd0a9a6045833fc58a68620d348a7245..54f5e112b8bc58995be6464ba7eb12293096f036 100644 (file)
@@ -96,6 +96,7 @@ namespace BL{
       std::string resource_choosed;
       std::string batch_queue;
       std::string wckey;
+      std::string extra_params;
 
       bool start_job;
       int dump_yacs_state;
index 8369dc74af18f7472c7076013a261d291b5e850c..3e57f6ea4c7a493fccb22389d996a8cca94373dd 100644 (file)
@@ -326,6 +326,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
   new_job->setBatchQueue(wizard.batch_queue);
   new_job->setLoadLevelerJobType(wizard.ll_jobtype);
   new_job->setWCKey(wizard.wckey);
+  new_job->setExtraParams(wizard.extra_params);
 
   // End
   addJobToLauncher(wizard.job_name);