]> SALOME platform Git repositories - modules/jobmanager.git/commitdiff
Salome HOME
- Add JobFile in BL_Job
authorribes <ribes>
Tue, 12 Jan 2010 16:42:10 +0000 (16:42 +0000)
committerribes <ribes>
Tue, 12 Jan 2010 16:42:10 +0000 (16:42 +0000)
- Add JobFile in the resume of the job
- Add EnvFile in the resume of the job

src/engine/BL_Job.cxx
src/engine/BL_Job.hxx
src/engine/BL_SALOMEServices.cxx
src/genericgui/BL_CreateJobWizard.cxx
src/genericgui/BL_JobTab.cxx
src/genericgui/BL_JobTab.hxx
src/genericgui/BL_JobsManager_QT.cxx

index 958117524a1da951eb6c9a38dd58a19727db9c4c..d49ce8ff2d7a2f8d4d38fc5b9c0a5a233c6204f3 100644 (file)
@@ -23,8 +23,7 @@ BL::Job::Job()
 {
   DEBTRACE("Creating BL::Job");
   _name = "";
-  _yacs_file = "";
-  _command = "";
+  _job_file = "";
   _env_file = "";
   _batch_params.batch_directory = "";
   _batch_params.maximum_duration = "";
@@ -42,8 +41,7 @@ BL::Job::Job(const std::string & name)
 {
   DEBTRACE("Creating BL::Job with name : " << name);
   _name = name;
-  _yacs_file = "";
-  _command = "";
+  _job_file = "";
   _env_file = "";
   _batch_params.batch_directory = "";
   _batch_params.maximum_duration = "";
@@ -85,27 +83,15 @@ BL::Job::getType()
 }
 
 void 
-BL::Job::setYACSFile(std::string & yacs_file)
+BL::Job::setJobFile(std::string & job_file)
 {
-  _yacs_file = yacs_file;
+  _job_file = job_file;
 }
 
 std::string & 
-BL::Job::getYACSFile()
+BL::Job::getJobFile()
 {
-  return _yacs_file;
-}
-
-void 
-BL::Job::setCommand(std::string & command)
-{
-  _command = command;
-}
-
-std::string & 
-BL::Job::getCommand()
-{
-  return _command;
+  return _job_file;
 }
 
 void 
index df38b68711a0aa492d5668ed770529cc6567a850..0f63344c4c46aa8f2b5b506fe60291deedd8c4a3 100644 (file)
@@ -41,11 +41,9 @@ namespace BL{
       void setType(BL::Job::JobType type);
       BL::Job::JobType getType();
 
-      void setYACSFile(std::string & yacs_file);
-      std::string & getYACSFile();
+      void setJobFile(std::string & job_file);
+      std::string & getJobFile();
 
-      void setCommand(std::string & command);
-      std::string & getCommand();
       void setEnvFile(std::string & env_file);
       std::string & getEnvFile();
 
@@ -93,8 +91,7 @@ namespace BL{
       std::string _name;
 
       BL::Job::JobType _type;
-      std::string _yacs_file;
-      std::string _command;
+      std::string _job_file;
       std::string _env_file;
   
       BL::Job::BatchParam _batch_params;
index 16910da766d11409312d4110cbd9be0b513cef26..157a5bbe0c8c8d85429f999f935a674e1ce7a62b 100644 (file)
@@ -94,15 +94,14 @@ BL::SALOMEServices::create_job(BL::Job * job)
   if (job->getType() == BL::Job::COMMAND)
   {
     job_parameters->job_type = CORBA::string_dup("command");
-    job_parameters->job_file = CORBA::string_dup(job->getCommand().c_str());
   }
   else if (job->getType() == BL::Job::YACS_SCHEMA)
   {
     job_parameters->job_type = CORBA::string_dup("yacs_file");
-    job_parameters->job_file = CORBA::string_dup(job->getYACSFile().c_str());
   }
 
   // Files
+  job_parameters->job_file = CORBA::string_dup(job->getJobFile().c_str());
   job_parameters->env_file = CORBA::string_dup(job->getEnvFile().c_str());
   BL::Job::FilesParam files = job->getFilesParameters();
   std::list<std::string>::iterator it;
@@ -131,7 +130,7 @@ BL::SALOMEServices::create_job(BL::Job * job)
   // Resource
   job_parameters->maximum_duration = CORBA::string_dup(cpp_batch_params.maximum_duration.c_str());
   job_parameters->resource_required.name = CORBA::string_dup(job->getResource().c_str());
-  job_parameters->resource_required.nb_node = cpp_batch_params.nb_proc;
+  job_parameters->resource_required.nb_proc = cpp_batch_params.nb_proc;
   job_parameters->queue = CORBA::string_dup(job->getBatchQueue().c_str());
 
   // Memory
index 733a2cb40b86957ba8bcc580a6c12bddf7f302bf..2839970c95e5e32626fffac0b6b57a91bf395b7d 100644 (file)
@@ -86,7 +86,12 @@ BL::CreateJobWizard::end(int result)
     QString f_command = field("command").toString();
     command = f_command.toStdString();
     
-    QString f_env_file = field("env_file").toString();
+    QString f_env_file;
+    
+    if (yacs_file != "")
+      f_env_file = field("env_yacs_file").toString();
+    else
+      f_env_file = field("env_command_file").toString();
     env_file = f_env_file.toStdString();
 
     // Batch Panel
@@ -247,7 +252,7 @@ BL::YACSSchemaPage::YACSSchemaPage(QWidget * parent)
   command_env_file_button->show();
   connect(command_env_file_button, SIGNAL(clicked()), this, SLOT(choose_env_file()));
   _line_env_file = new QLineEdit(this);
-  registerField("env_file", _line_env_file);
+  registerField("env_yacs_file", _line_env_file);
   _line_env_file->setReadOnly(true);
 
   QVBoxLayout * main_layout = new QVBoxLayout;
@@ -329,7 +334,7 @@ BL::CommandMainPage::CommandMainPage(QWidget * parent)
   command_env_file_button->show();
   connect(command_env_file_button, SIGNAL(clicked()), this, SLOT(choose_env_file()));
   _line_env_file = new QLineEdit(this);
-  registerField("env_file", _line_env_file);
+  registerField("env_command_file", _line_env_file);
   _line_env_file->setReadOnly(true);
 
   QGridLayout *layout = new QGridLayout;
index c78d93c810a704e36680f2bf0e1ed33e83997f47..cd23a9dcc1691f15705a2c4b1113d648bde7518b 100644 (file)
@@ -63,8 +63,10 @@ BL::JobTab::createJobSummaryTab()
   _job_state_label_value = new QLabel("");
   QLabel * job_resource_label = new QLabel("Resource:");
   _job_resource_label_value = new QLabel("");
-  _job_command_label = new QLabel("Schema or Command:");
-  _job_command_label_value = new QLabel("");
+  QLabel * job_jobfile_label = new QLabel("Job File:");
+  _job_jobfile_label_value = new QLabel("");
+  QLabel * job_envfile_label = new QLabel("Env File:");
+  _job_envfile_label_value = new QLabel("");
 
   QGroupBox * main_values_box = new QGroupBox("Main values");
   QFormLayout * values_form = new QFormLayout;
@@ -72,7 +74,8 @@ BL::JobTab::createJobSummaryTab()
   values_form->insertRow(1, job_type_label, _job_type_label_value);
   values_form->insertRow(2, job_state_label, _job_state_label_value);
   values_form->insertRow(3, job_resource_label, _job_resource_label_value);
-  values_form->insertRow(4, _job_command_label, _job_command_label_value);
+  values_form->insertRow(4, job_jobfile_label, _job_jobfile_label_value);
+  values_form->insertRow(5, job_envfile_label, _job_envfile_label_value);
   main_values_box->setLayout(values_form);
 
   QLabel * job_nif_label = new QLabel("Number of Input Files:");
@@ -164,18 +167,12 @@ BL::JobTab::job_selected(const QModelIndex & index)
     else 
       _job_state_label_value->setText("Finished");
 
+    _job_jobfile_label_value->setText(QString(job->getJobFile().c_str()));
+    _job_envfile_label_value->setText(QString(job->getEnvFile().c_str()));
     if (job->getType() == BL::Job::YACS_SCHEMA)
-    {
-      _job_command_label->setText("Schema:");
-      _job_command_label_value->setText(QString(job->getYACSFile().c_str()));
       _job_type_label_value->setText("YACS_Schema");
-    }
     else
-    {
-      _job_command_label->setText("Command:");
-      _job_command_label_value->setText(QString(job->getCommand().c_str()));
       _job_type_label_value->setText("Command");
-    }
 
     _job_resource_label_value->setText(QString(job->getResource().c_str()));
 
@@ -251,8 +248,8 @@ BL::JobTab::reset(QString job_name)
   _job_mdt_label_value->setText("");
   _job_em_label_value->setText("");
   _job_nop_label_value->setText("");
-  _job_command_label->setText("Schema or Command:");
-  _job_command_label_value->setText("");
+  _job_jobfile_label_value->setText("");
+  _job_envfile_label_value->setText("");
 
   _input_files_list->clear();
   _output_files_list->clear();
index cd40316f0e444e63d4e9d30274ee03b75f04b664..58097ea21f3ecc1099d5b8dbb65b0fb7fc35baca 100644 (file)
@@ -55,8 +55,8 @@ namespace BL
       QLabel * _job_type_label_value;
       QLabel * _job_state_label_value;
       QLabel * _job_resource_label_value;
-      QLabel * _job_command_label;
-      QLabel * _job_command_label_value;
+      QLabel * _job_jobfile_label_value;
+      QLabel * _job_envfile_label_value;
 
       // Run Values
       QLabel * _job_nif_label_value;
index c9d642b83b9a5a03aeea7f3f84d6e8bb606a723b..3c0db8946a8dc18ae553daf39d04bd5c05c830ac 100644 (file)
@@ -160,42 +160,32 @@ BL::JobsManager_QT::create_job_wizard()
       {
        // YACS schema job
        new_job->setType(BL::Job::YACS_SCHEMA);
-       new_job->setYACSFile(wizard.yacs_file);
-       new_job->setEnvFile(wizard.env_file);
-       BL::Job::BatchParam param;
-       param.batch_directory = wizard.batch_directory;
-       param.maximum_duration = wizard.maximum_duration;
-       param.expected_memory = wizard.expected_memory;
-       param.nb_proc = wizard.nb_proc;
-       new_job->setBatchParameters(param);
-       BL::Job::FilesParam files_params;
-       files_params.result_directory = wizard.result_directory;
-       files_params.input_files_list = wizard.input_files_list;
-       files_params.output_files_list = wizard.output_files_list;
-       new_job->setFilesParameters(files_params);
-       new_job->setResource(wizard.resource_choosed);
-       new_job->setBatchQueue(wizard.batch_queue);
+       new_job->setJobFile(wizard.yacs_file);
       }
       else
       {
        // Command Job
        new_job->setType(BL::Job::COMMAND);
-       new_job->setCommand(wizard.command);
-       new_job->setEnvFile(wizard.env_file);
-       BL::Job::BatchParam param;
-       param.batch_directory = wizard.batch_directory;
-       param.maximum_duration = wizard.maximum_duration;
-       param.expected_memory = wizard.expected_memory;
-       param.nb_proc = wizard.nb_proc;
-       new_job->setBatchParameters(param);
-       BL::Job::FilesParam files_params;
-       files_params.result_directory = wizard.result_directory;
-       files_params.input_files_list = wizard.input_files_list;
-       files_params.output_files_list = wizard.output_files_list;
-       new_job->setFilesParameters(files_params);
-       new_job->setResource(wizard.resource_choosed);
-       new_job->setBatchQueue(wizard.batch_queue);
+       new_job->setJobFile(wizard.command);
       }
+
+      // For all jobs
+      new_job->setEnvFile(wizard.env_file);
+      BL::Job::BatchParam param;
+      param.batch_directory = wizard.batch_directory;
+      param.maximum_duration = wizard.maximum_duration;
+      param.expected_memory = wizard.expected_memory;
+      param.nb_proc = wizard.nb_proc;
+      new_job->setBatchParameters(param);
+      BL::Job::FilesParam files_params;
+      files_params.result_directory = wizard.result_directory;
+      files_params.input_files_list = wizard.input_files_list;
+      files_params.output_files_list = wizard.output_files_list;
+      new_job->setFilesParameters(files_params);
+      new_job->setResource(wizard.resource_choosed);
+      new_job->setBatchQueue(wizard.batch_queue);
+      
+      // End
       addJobToLauncher(wizard.job_name);
       emit new_job_added(QString::fromStdString(wizard.job_name));
       if (wizard.start_job)