]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Add job parameter 'exclusive' to let the user choose to share nodes or not (EDF issue... BR_new_bop4
authorbarate <barate>
Wed, 28 Aug 2013 15:53:23 +0000 (15:53 +0000)
committerbarate <barate>
Wed, 28 Aug 2013 15:53:23 +0000 (15:53 +0000)
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_JobTab.cxx
src/genericgui/BL_JobTab.hxx
src/genericgui/BL_JobsManager_QT.cxx

index b179ba6359e471a59e9892a7e48b0551e00656d0..ba78ceffb353ceda03319b84c696f11ef30cf336 100644 (file)
@@ -29,6 +29,7 @@ BL::Job::Job()
   _batch_params.maximum_duration = "";
   _batch_params.expected_memory = "";
   _batch_params.nb_proc = 0;
+  _batch_params.exclusive = false;
   _files_params.result_directory = "";
   _resource_choosed = "";
   _batch_queue = "";
@@ -53,6 +54,7 @@ BL::Job::Job(const std::string & name)
   _batch_params.maximum_duration = "";
   _batch_params.expected_memory = "";
   _batch_params.nb_proc = 0;
+  _batch_params.exclusive = false;
   _files_params.result_directory = "";
   _resource_choosed = "";
   _batch_queue = "";
@@ -148,19 +150,12 @@ BL::Job::getEnvFile()
 }
 
 void 
-BL::Job::setBatchParameters(BL::Job::BatchParam & param)
+BL::Job::setBatchParameters(const BL::Job::BatchParam & param)
 {
-  _batch_params.batch_directory = param.batch_directory;
-  _batch_params.maximum_duration = param.maximum_duration;
-  _batch_params.expected_memory = param.expected_memory;
-  _batch_params.nb_proc = param.nb_proc;
-
-  // Parameters for COORM
-  _batch_params.launcher_file = param.launcher_file;
-  _batch_params.launcher_args = param.launcher_args;
+  _batch_params = param;
 }
 
-BL::Job::BatchParam & 
+const BL::Job::BatchParam &
 BL::Job::getBatchParameters()
 {
   return _batch_params;
index 576ee8c6efdaf5e6cf1e8446874e9ed89cda2378..464abb3a4e168a6b614e71892aec4a3289c4abb8 100644 (file)
@@ -62,13 +62,14 @@ namespace BL{
         std::string maximum_duration;
         std::string expected_memory;
         int nb_proc;
+        bool exclusive;
 
                // Parameters for COORM
                std::string launcher_file;
                std::string launcher_args;
       };
-      void setBatchParameters(BL::Job::BatchParam & param);
-      BL::Job::BatchParam & getBatchParameters();
+      void setBatchParameters(const BL::Job::BatchParam & param);
+      const BL::Job::BatchParam & getBatchParameters();
 
       struct FilesParam
       {
index 0eb772e05519a2c1ad09c93533b4a7ca92ba9b61..911e5649669bb7d23d50d5371f619e4ebdccac3e 100644 (file)
@@ -320,6 +320,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
   job_parameters->resource_required.name = CORBA::string_dup(job->getResource().c_str());
   job_parameters->resource_required.nb_proc = cpp_batch_params.nb_proc;
   job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str());
+  job_parameters->exclusive = cpp_batch_params.exclusive;
 
   // Memory
   CORBA::Long memory;
@@ -623,6 +624,7 @@ BL::SALOMEServices::get_new_job(int job_number)
     batch_param.batch_directory = job_parameters->work_directory.in();
     batch_param.maximum_duration = job_parameters->maximum_duration.in();
     batch_param.nb_proc = job_parameters->resource_required.nb_proc;
+    batch_param.exclusive = job_parameters->exclusive;
     std::ostringstream mem_stream;
     mem_stream << job_parameters->resource_required.mem_mb << "mb";
     batch_param.expected_memory = mem_stream.str();
index a59b94423f2f8d78f705d6c426e9bd70e88c75f4..646d253a65cb5c584999e21cff2e59e4d6c59bc6 100644 (file)
@@ -157,6 +157,8 @@ BL::CreateJobWizard::clone(const std::string & name)
     proc_value.setNum(batch_params.nb_proc);
     setField("proc_value", proc_value);
 
+    setField("exclusive", batch_params.exclusive);
+
     if (batch_params.maximum_duration == "")
     {
       setField("duration_hour", 0);
@@ -285,6 +287,7 @@ BL::CreateJobWizard::end(int result)
     expected_memory = mem.trimmed().toStdString() + mem_type.toStdString();
 
     nb_proc = field("proc_value").toInt();
+    exclusive = field("exclusive").toBool();
 
     // Files Panel
     QString f_result_directory = field("result_directory").toString();
@@ -389,21 +392,30 @@ void
 BL::JobNamePage::yacs_schema_button(bool checked)
 {
   if (checked)
+  {
     _explanation->setText("This job permits to launch a YACS schema into a SALOME application");
+    setField("exclusive", true);
+  }
 }
 
 void
 BL::JobNamePage::command_button(bool checked)
 {
   if (checked)
+  {
     _explanation->setText("This job permits to launch a script into a distributed resource. This script is not launched into a SALOME application");
+    setField("exclusive", false);
+  }
 }
 
 void
 BL::JobNamePage::python_salome_button(bool checked)
 {
   if (checked)
+  {
     _explanation->setText("This job permits to launch a python script into a SALOME application");
+    setField("exclusive", true);
+  }
 }
 
 bool
@@ -647,7 +659,7 @@ BL::BatchParametersPage::BatchParametersPage(QWidget * parent, BL::SALOMEService
   registerField("batch_directory", line_directory);
 
   // exected during time
-  QLabel * label_duration = new QLabel("Maximum during time: ");
+  QLabel * label_duration = new QLabel("Time limit: ");
   QSpinBox * spin_duration_hour = new QSpinBox(this);
   QLabel * label_duration_hour = new QLabel("Hours");
   spin_duration_hour->setMinimum(0);
@@ -660,7 +672,7 @@ BL::BatchParametersPage::BatchParametersPage(QWidget * parent, BL::SALOMEService
   registerField("duration_min", spin_duration_min);
 
   // memory
-  QLabel * label_memory = new QLabel("Memory per nodes expected: ");
+  QLabel * label_memory = new QLabel("Memory per node: ");
   QSpinBox * spin_memory = new QSpinBox(this);
   spin_memory->setMinimum(0);
   spin_memory->setMaximum(1000000);
@@ -672,12 +684,18 @@ BL::BatchParametersPage::BatchParametersPage(QWidget * parent, BL::SALOMEService
   registerField("mem_type", combo_memory);
 
   // proc
-  QLabel * label_proc = new QLabel("Number of proc expected: ");
+  QLabel * label_proc = new QLabel("Number of cores: ");
   QSpinBox * spin_proc = new QSpinBox(this);
   spin_proc->setMinimum(1);
   spin_proc->setMaximum(1000000);
   registerField("proc_value", spin_proc);
 
+  // exclusive
+  QLabel * label_exclusive = new QLabel("Exclusive (do not share nodes with other jobs): ");
+  QCheckBox * check_exclusive = new QCheckBox(this);
+  check_exclusive->setChecked(true);
+  registerField("exclusive", check_exclusive);
+
   QGridLayout *layout = new QGridLayout;
   layout->addWidget(label_directory, 0, 0);
   layout->addWidget(line_directory, 0, 1, 1, -1);
@@ -691,6 +709,8 @@ BL::BatchParametersPage::BatchParametersPage(QWidget * parent, BL::SALOMEService
   layout->addWidget(combo_memory, 2, 2);
   layout->addWidget(label_proc, 3, 0);
   layout->addWidget(spin_proc, 3, 1);
+  layout->addWidget(label_exclusive, 4, 0);
+  layout->addWidget(check_exclusive, 4, 1);
 
   main_layout->insertLayout(-1, layout);
 
index a50960431d88177efb90f825ede09d1bf6942d05..cbdcdbe2d0a1959ae524b11cfff2ee271adda3d1 100644 (file)
@@ -76,6 +76,7 @@ namespace BL{
          std::string maximum_duration;
       std::string expected_memory;
       int nb_proc;
+      bool exclusive;
 
          // Parameters for COORM
          std::string launcher_file;
index 7fa632237b3679df7f1fa71edfaba2d0092c8c4f..eaf9bbef96ec9a495c42bae42c52f3458120d70b 100644 (file)
@@ -102,6 +102,8 @@ BL::JobTab::createJobSummaryTab()
   _job_em_label_value = new QLabel("");
   QLabel * job_nop_label = new QLabel("Number of processors:");
   _job_nop_label_value = new QLabel("");
+  QLabel * job_excl_label = new QLabel("Exclusive:");
+  _job_excl_label_value = new QLabel("");
 
   // Parameters for COORM
   QLabel * job_lf_label = new QLabel("Launcher file:");
@@ -129,9 +131,10 @@ BL::JobTab::createJobSummaryTab()
   _other_run_values_form->insertRow(0, job_mdt_label, _job_mdt_label_value);
   _other_run_values_form->insertRow(1, job_em_label, _job_em_label_value);
   _other_run_values_form->insertRow(2, job_nop_label, _job_nop_label_value);
+  _other_run_values_form->insertRow(3, job_excl_label, _job_excl_label_value);
 
   // Parameters for COORM
-  _other_run_values_form->insertRow(3, job_la_label, _job_la_label_value);
+  _other_run_values_form->insertRow(4, job_la_label, _job_la_label_value);
 
   QHBoxLayout * box_layout = new QHBoxLayout();
   box_layout->addLayout(_run_values_form);
@@ -233,6 +236,8 @@ BL::JobTab::job_selected(const QModelIndex & index)
     _job_mdt_label_value->setText(QString(batch_params.maximum_duration.c_str()));
     _job_em_label_value->setText(QString(batch_params.expected_memory.c_str()));
     _job_nop_label_value->setText(QVariant(batch_params.nb_proc).toString());
+    QString exclText = (batch_params.exclusive)? "yes" : "no";
+    _job_excl_label_value->setText(exclText);
 
        // Parameters for COORM
     _job_lf_label_value->setText(QString(batch_params.launcher_file.c_str()));
@@ -322,6 +327,7 @@ BL::JobTab::reset(QString job_name)
     _job_mdt_label_value->setText("");
     _job_em_label_value->setText("");
     _job_nop_label_value->setText("");
+    _job_excl_label_value->setText("");
     _job_jobfile_label_value->setText("");
     _job_envfile_label_value->setText("");
 
index 3f9226bfa0e2609e8cdebc83fec85a96870c16f2..1b8f229a2e5f15b5fb4f320d984817448475675e 100644 (file)
@@ -72,6 +72,7 @@ namespace BL
       QLabel * _job_mdt_label_value;
       QLabel * _job_em_label_value;
       QLabel * _job_nop_label_value;
+      QLabel * _job_excl_label_value;
 
       // Specific Values
       QLabel * _yacs_dump_state_label;
index 74820ccb41a9e55a95f22ff694256ea9fc9651b6..987f1f814f92be81979c9973f7ec74c7a4fed2cb 100644 (file)
@@ -308,6 +308,7 @@ BL::JobsManager_QT::create_job_with_wizard(BL::CreateJobWizard & wizard)
   param.maximum_duration = wizard.maximum_duration;
   param.expected_memory = wizard.expected_memory;
   param.nb_proc = wizard.nb_proc;
+  param.exclusive = wizard.exclusive;
 
   // Parameters for COORM
   param.launcher_file = wizard.launcher_file;