]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
Adding queue support
authorribes <ribes>
Tue, 17 Nov 2009 09:25:13 +0000 (09:25 +0000)
committerribes <ribes>
Tue, 17 Nov 2009 09:25:13 +0000 (09:25 +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_JobsManager_QT.cxx

index 3d9244563461a761dff9ab4c64c35a352fffddde..7aab92fc1632cfaf8bb922226507d7295ed4e601 100644 (file)
@@ -32,6 +32,7 @@ BL::Job::Job()
   _batch_params.nb_proc = 0;
   _files_params.result_directory = "";
   _machine_choosed = "";
+  _batch_queue = "";
   _state = BL::Job::CREATED;
   _thread_state = BL::Job::NOTHING;
   _salome_launcher_id = -1;
@@ -50,6 +51,7 @@ BL::Job::Job(const std::string & name)
   _batch_params.nb_proc = 0;
   _files_params.result_directory = "";
   _machine_choosed = "";
+  _batch_queue = "";
   _state = BL::Job::CREATED;
   _thread_state = BL::Job::NOTHING;
   _salome_launcher_id = -1;
@@ -159,6 +161,18 @@ BL::Job::getMachine()
   return _machine_choosed;
 }
 
+void
+BL::Job::setBatchQueue(std::string & queue)
+{
+  _batch_queue = queue;
+}
+
+std::string &
+BL::Job::getBatchQueue()
+{
+  return _batch_queue;
+}
+
 void 
 BL::Job::setState(BL::Job::State state)
 {
index 2525a963d7f9c6004d4b7645ce177e75d1d1913a..7d99b8fc1f1c57ce5be10e0b92089cf2be52503f 100644 (file)
@@ -71,6 +71,9 @@ namespace BL{
       void setMachine(std::string & machine);
       std::string & getMachine();
 
+      void setBatchQueue(std::string & queue);
+      std::string & getBatchQueue();
+
       enum State {CREATED, IN_PROCESS, QUEUED, RUNNING, PAUSED, FINISHED, ERROR};
       void setState(BL::Job::State state);
       BL::Job::State getState();
@@ -97,6 +100,7 @@ namespace BL{
       BL::Job::BatchParam _batch_params;
       BL::Job::FilesParam _files_params;
       std::string _machine_choosed;
+      std::string _batch_queue;
 
       int _salome_launcher_id;
   };
index 7ec3342bd0a81c8362bee13c9dfa97e494f9f281..21d24b2ee7ea262b31c3739680eaa3e85fb1a7b2 100644 (file)
@@ -132,6 +132,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
   job_parameters->maximum_during_time = CORBA::string_dup(cpp_batch_params.maximum_during_time.c_str());
   job_parameters->resource_required.hostname = CORBA::string_dup(job->getMachine().c_str());
   job_parameters->resource_required.nb_node = cpp_batch_params.nb_proc;
+  job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str());
 
   // Memory
   CORBA::Long memory;
index 2d05ae37cd6032dda8f7b183c865181446762b23..bee52f0b5bc9eebb720196984494925074ebf010 100644 (file)
@@ -38,6 +38,7 @@ BL::CreateJobWizard::CreateJobWizard(BL::JobsManager_QT * jobs_manager, BL::SALO
   result_directory = "";
 
   machine_choosed = "";
+  batch_queue = "";
 
   start_job = false;
 
@@ -132,6 +133,10 @@ BL::CreateJobWizard::end(int result)
     QString f_machine_choosed = field("machine_choosed").toString();
     machine_choosed = f_machine_choosed.toStdString(); 
 
+    // Batch Queue
+    QString f_batch_queue = field("batch_queue").toString();
+    batch_queue = f_batch_queue.toStdString(); 
+
     start_job = field("start_job").toBool();
   }
 }
@@ -684,10 +689,16 @@ BL::MachinePage::MachinePage(BL::CreateJobWizard * parent, BL::SALOMEServices *
   _machine_choosed->setReadOnly(true);
   registerField("machine_choosed", _machine_choosed);
 
+  QLabel * bqLabel = new QLabel("Batch Queue (optional):");
+  QLineEdit * _bqLineEdit = new QLineEdit(this);
+  registerField("batch_queue", _bqLineEdit);
+
   QGridLayout * main_layout = new QGridLayout;
   main_layout->addWidget(machine_group_box, 0, 0, 1, -1);
   main_layout->addWidget(machine_label, 1, 0);
   main_layout->addWidget(_machine_choosed, 1, 1);
+  main_layout->addWidget(bqLabel, 2, 0);
+  main_layout->addWidget(_bqLineEdit, 2, 1);
   setLayout(main_layout);
 };
 
index 4f1a776fa1877ec1e84dccbde9c372e63f64294b..f19c1167ba408a53e426f88f73cde78835a23a6f 100644 (file)
@@ -71,6 +71,7 @@ namespace BL{
       std::list<std::string> output_files_list;
 
       std::string machine_choosed;
+      std::string batch_queue;
 
       bool start_job;
 
index 3bc5f4e0c5326a41a649f89e68d8dd392553e033..471a9afecae00fceb33e6e6718b29da42bbc17f6 100644 (file)
@@ -173,6 +173,7 @@ BL::JobsManager_QT::create_job_wizard()
        files_params.output_files_list = wizard.output_files_list;
        new_job->setFilesParameters(files_params);
        new_job->setMachine(wizard.machine_choosed);
+       new_job->setBatchQueue(wizard.batch_queue);
       }
       else
       {
@@ -192,6 +193,7 @@ BL::JobsManager_QT::create_job_wizard()
        files_params.output_files_list = wizard.output_files_list;
        new_job->setFilesParameters(files_params);
        new_job->setMachine(wizard.machine_choosed);
+       new_job->setBatchQueue(wizard.batch_queue);
       }
       addJobToLauncher(wizard.job_name);
       emit new_job_added(QString::fromStdString(wizard.job_name));