From fb08105c2b1c31598a4e0579e098e94a96524bbe Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Tue, 7 Oct 2014 17:28:14 +0200 Subject: [PATCH] Add possibility to specify extra parameters in the job submission file --- src/engine/BL_Job.cxx | 12 ++++ src/engine/BL_Job.hxx | 4 ++ src/engine/BL_SALOMEServices.cxx | 2 + .../AdvancedParametersWizardPage.ui | 66 ++++++++++++++++--- src/genericgui/BL_CreateJobWizard.cxx | 6 ++ src/genericgui/BL_CreateJobWizard.hxx | 1 + src/genericgui/BL_JobsManager_QT.cxx | 1 + 7 files changed, 84 insertions(+), 8 deletions(-) diff --git a/src/engine/BL_Job.cxx b/src/engine/BL_Job.cxx index 6f7886b..316360b 100644 --- a/src/engine/BL_Job.cxx +++ b/src/engine/BL_Job.cxx @@ -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) { diff --git a/src/engine/BL_Job.hxx b/src/engine/BL_Job.hxx index 646949a..26e81fc 100644 --- a/src/engine/BL_Job.hxx +++ b/src/engine/BL_Job.hxx @@ -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; diff --git a/src/engine/BL_SALOMEServices.cxx b/src/engine/BL_SALOMEServices.cxx index c5c1129..e0d68ac 100644 --- a/src/engine/BL_SALOMEServices.cxx +++ b/src/engine/BL_SALOMEServices.cxx @@ -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(); diff --git a/src/genericgui/AdvancedParametersWizardPage.ui b/src/genericgui/AdvancedParametersWizardPage.ui index ca09411..6509720 100644 --- a/src/genericgui/AdvancedParametersWizardPage.ui +++ b/src/genericgui/AdvancedParametersWizardPage.ui @@ -2,20 +2,70 @@ AdvancedParametersWizardPage + + + 0 + 0 + 589 + 441 + + Advanced Parameters - - - - - Workload Characterization Key (wckey): + + + + + + + Workload Characterization Key (wckey): + + + + + + + + + + + + Extra parameters + + + + + <html> +<head> +<style type="text/css"> +.code{font-family: monospace} +</style> +</head> +<body><p align="justify">The following text will be added &quot;as is&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.</p> +<p>Example:</p> +<div class="code">#MSUB -@ jonathan.xxx@cea.fr:begin,end<br/> +export OMPI_MCA_orte_process_binding=none<br/> +...</div></body></html> + + + true + + + + + + + + Monospace + + + + + - - - diff --git a/src/genericgui/BL_CreateJobWizard.cxx b/src/genericgui/BL_CreateJobWizard.cxx index 353704b..9d9ea3c 100644 --- a/src/genericgui/BL_CreateJobWizard.cxx +++ b/src/genericgui/BL_CreateJobWizard.cxx @@ -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() diff --git a/src/genericgui/BL_CreateJobWizard.hxx b/src/genericgui/BL_CreateJobWizard.hxx index 757f219..54f5e11 100644 --- a/src/genericgui/BL_CreateJobWizard.hxx +++ b/src/genericgui/BL_CreateJobWizard.hxx @@ -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; diff --git a/src/genericgui/BL_JobsManager_QT.cxx b/src/genericgui/BL_JobsManager_QT.cxx index 8369dc7..3e57f6e 100644 --- a/src/genericgui/BL_JobsManager_QT.cxx +++ b/src/genericgui/BL_JobsManager_QT.cxx @@ -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); -- 2.39.2