From: Renaud Barate Date: Mon, 6 Oct 2014 16:03:07 +0000 (+0200) Subject: Add batch parameter wckey to SALOME Launcher X-Git-Tag: V7_5_0a1~3^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9121eb35a085ef28077fa5f70619e18952ef3f6e;p=modules%2Fkernel.git Add batch parameter wckey to SALOME Launcher --- diff --git a/idl/SALOME_Launcher.idl b/idl/SALOME_Launcher.idl index 40ea4a869..8dbe5cd5c 100644 --- a/idl/SALOME_Launcher.idl +++ b/idl/SALOME_Launcher.idl @@ -79,6 +79,9 @@ struct JobParameters //! Specifies the memory limit per cpu (exclusive with resource_required.mem_mb) unsigned long mem_per_cpu; + //! Workload Characterization Key - mandatory on some clusters + string wckey; + /*! Specific parameters for each type of job - optional */ diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 7874bfd90..94535df5c 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -325,6 +325,12 @@ Launcher::Job::setMemPerCpu(unsigned long mem_per_cpu) _mem_per_cpu = mem_per_cpu; } +void +Launcher::Job::setWCKey(const std::string & wckey) +{ + _wckey = wckey; +} + void Launcher::Job::setReference(const std::string & reference) { @@ -409,6 +415,12 @@ Launcher::Job::getMemPerCpu() const return _mem_per_cpu; } +std::string +Launcher::Job::getWCKey() const +{ + return _wckey; +} + std::string Launcher::Job::getReference() const { @@ -632,6 +644,10 @@ Launcher::Job::common_job_params() if (getExclusive()) params[Batch::EXCLUSIVE] = true; + // WC Key + if (_wckey != "") + params[Batch::WCKEY] = _wckey; + // Specific parameters std::map::iterator it = _specific_parameters.find("LoalLevelerJobType"); if (it != _specific_parameters.end()) diff --git a/src/Launcher/Launcher_Job.hxx b/src/Launcher/Launcher_Job.hxx index 1ed3030f2..cb9e5d8de 100644 --- a/src/Launcher/Launcher_Job.hxx +++ b/src/Launcher/Launcher_Job.hxx @@ -79,6 +79,7 @@ namespace Launcher void setExclusive(bool exclusive); void setExclusiveStr(const std::string & exclusiveStr); void setMemPerCpu(unsigned long mem_per_cpu); + void setWCKey(const std::string & wckey); void setReference(const std::string & reference); // For COORM void setLauncherFile(const std::string & launcher_file); @@ -99,6 +100,7 @@ namespace Launcher bool getExclusive() const; std::string getExclusiveStr() const; unsigned long getMemPerCpu() const; + std::string getWCKey() const; std::string getReference() const; // For COORM @@ -155,6 +157,7 @@ namespace Launcher std::string _queue; bool _exclusive; unsigned long _mem_per_cpu; + std::string _wckey; std::string _reference; //! Reference of the job for the batch manager // Parameters for COORM diff --git a/src/Launcher/Launcher_XML_Persistence.cxx b/src/Launcher/Launcher_XML_Persistence.cxx index 5e7aaaac1..e1218cbc0 100644 --- a/src/Launcher/Launcher_XML_Persistence.cxx +++ b/src/Launcher/Launcher_XML_Persistence.cxx @@ -198,6 +198,8 @@ XML_Persistence::addJobToXmlDocument(xmlNodePtr root_node, const Job & job) addNode(node, "exclusive", job.getExclusiveStr()); if (job.getMemPerCpu() > 0) addNumericalNode(res_node, "mem_per_cpu", job.getMemPerCpu()); + if (!job.getWCKey().empty()) + addNode(node, "wckey", job.getWCKey()); // Specific parameters part map specific_parameters = job.getSpecificParameters(); @@ -332,6 +334,8 @@ XML_Persistence::parseUserNode(Job * new_job, xmlNodePtr user_node) new_job->setExclusiveStr(getNodeContent(current_node)); else if (node_name == "mem_per_cpu") new_job->setMemPerCpu(getNumericalNodeContent(current_node)); + else if (node_name == "wckey") + new_job->setWCKey(getNodeContent(current_node)); else if (node_name == "specific_parameters") { // Get specific parameters diff --git a/src/Launcher/SALOME_Launcher.cxx b/src/Launcher/SALOME_Launcher.cxx index 4fc419d38..3a66f87da 100644 --- a/src/Launcher/SALOME_Launcher.cxx +++ b/src/Launcher/SALOME_Launcher.cxx @@ -165,6 +165,10 @@ SALOME_Launcher::createJob(const Engines::JobParameters & job_parameters) // Memory required per CPU new_job->setMemPerCpu(job_parameters.mem_per_cpu); + // WC Key + std::string wckey = job_parameters.wckey.in(); + new_job->setWCKey(wckey); + // Resources requirements try { @@ -502,6 +506,7 @@ SALOME_Launcher::getJobParameters(CORBA::Long job_id) job_parameters->queue = CORBA::string_dup(job->getQueue().c_str()); job_parameters->exclusive = job->getExclusive(); job_parameters->mem_per_cpu = job->getMemPerCpu(); + job_parameters->wckey = CORBA::string_dup(job->getWCKey().c_str()); resourceParams resource_params = job->getResourceRequiredParams(); job_parameters->resource_required.name = CORBA::string_dup(resource_params.name.c_str());