Name of the batch queue choosed - optional
*/
string queue;
+
+ //! Specifies if the job must run in exclusive mode (without sharing nodes with other jobs)
+ boolean exclusive;
/*!
Specific parameters for each type of job - optional
_resource_required_params.mem_mb = -1;
_queue = "";
_job_type = "";
+ _exclusive = false;
// Parameters for COORM
_launcher_file = "";
_queue = queue;
}
+void
+Launcher::Job::setExclusive(bool exclusive)
+{
+ _exclusive = exclusive;
+}
+
+void
+Launcher::Job::setExclusiveStr(const std::string & exclusiveStr)
+{
+ if (exclusiveStr == "true")
+ _exclusive = true;
+ else if (exclusiveStr == "false")
+ _exclusive = false;
+ else
+ throw LauncherException(std::string("Invalid boolean value for exclusive: ") + exclusiveStr);
+}
+
std::string
Launcher::Job::getWorkDirectory()
{
return _queue;
}
+bool
+Launcher::Job::getExclusive()
+{
+ return _exclusive;
+}
+
+std::string
+Launcher::Job::getExclusiveStr() const
+{
+ return _exclusive ? "true" : "false";
+}
+
void
Launcher::Job::checkMaximumDuration(const std::string & maximum_duration)
{
if (_queue != "")
params[Batch::QUEUE] = _queue;
+ // Exclusive
+ if (getExclusive())
+ params[Batch::EXCLUSIVE] = true;
+
// Specific parameters
std::map<std::string, std::string>::iterator it = _specific_parameters.find("LoalLevelerJobType");
if (it != _specific_parameters.end())
xmlNewChild(node, NULL, xmlCharStrdup("maximum_duration"), xmlCharStrdup(getMaximumDuration().c_str()));
xmlNewChild(node, NULL, xmlCharStrdup("queue"), xmlCharStrdup(getQueue().c_str()));
+ xmlNewChild(node, NULL, xmlCharStrdup("exclusive"), xmlCharStrdup(getExclusiveStr().c_str()));
// For COORM
xmlNewChild(node, NULL, xmlCharStrdup("launcher_args"), xmlCharStrdup(getLauncherArgs().c_str()));
void setResourceRequiredParams(const resourceParams & resource_required_params);
void setQueue(const std::string & queue);
void setEnvFile(const std::string & env_file);
-
+ void setExclusive(bool exclusive);
+ void setExclusiveStr(const std::string & exclusiveStr);
// For COORM
void setLauncherFile(const std::string & launcher_file);
void setLauncherArgs(const std::string & launcher_args);
std::string getQueue();
std::string getEnvFile();
std::string getJobType();
+ bool getExclusive();
+ std::string getExclusiveStr() const;
// For COORM
std::string getLauncherFile();
long _maximum_duration_in_second;
resourceParams _resource_required_params;
std::string _queue;
+ bool _exclusive;
// Parameters for COORM
std::string _launcher_file;
#ifdef WITH_LIBBATCH
Batch::Parametre params = common_job_params();
params[Batch::EXECUTABLE] = buildCommandScript(params, _launch_date);
- params[Batch::EXCLUSIVE] = false;
_batch_job->setParametre(params);
#endif
}
#ifdef WITH_LIBBATCH
Batch::Parametre params = common_job_params();
params[Batch::EXECUTABLE] = buildSalomeScript(params);
- params[Batch::EXCLUSIVE] = true;
_batch_job->setParametre(params);
#endif
}
std::string queue = job_parameters.queue.in();
new_job->setQueue(queue);
+ // Exclusive
+ new_job->setExclusive(job_parameters.exclusive);
+
// Resources requirements
try
{
job_parameters->maximum_duration = CORBA::string_dup(job->getMaximumDuration().c_str());
job_parameters->queue = CORBA::string_dup(job->getQueue().c_str());
+ job_parameters->exclusive = job->getExclusive();
resourceParams resource_params = job->getResourceRequiredParams();
job_parameters->resource_required.name = CORBA::string_dup(resource_params.name.c_str());
xmlNodePtr res_node = xmlNextElementSibling(files_node);
xmlNodePtr maximum_duration_node = xmlNextElementSibling(res_node);
xmlNodePtr queue_node = xmlNextElementSibling(maximum_duration_node);
- xmlNodePtr launcher_args_node = xmlNextElementSibling(queue_node);
+ xmlNodePtr exclusive_node = xmlNextElementSibling(queue_node);
+ xmlNodePtr launcher_args_node = xmlNextElementSibling(exclusive_node);
if (res_node == NULL ||
maximum_duration_node == NULL ||
queue_node == NULL ||
+ exclusive_node == NULL ||
// For COORM
launcher_args_node == NULL
)
if (xmlStrcmp(res_node->name, xmlCharStrdup("resource_params")) ||
xmlStrcmp(maximum_duration_node->name, xmlCharStrdup("maximum_duration")) ||
xmlStrcmp(queue_node->name, xmlCharStrdup("queue")) ||
+ xmlStrcmp(exclusive_node->name, xmlCharStrdup("exclusive")) ||
// For COORM
xmlStrcmp(launcher_args_node->name, xmlCharStrdup("launcher_args"))
)
xmlFree(maximum_duration);
xmlFree(queue);
+ xmlChar* exclusive = xmlNodeGetContent(exclusive_node);
+ try
+ {
+ new_job->setExclusiveStr(std::string((const char *)exclusive));
+ }
+ catch(const LauncherException &ex)
+ {
+ INFOS("Exception received for exclusive, cannot add the job. " << ex.msg.c_str());
+ delete new_job;
+ xmlFree(exclusive);
+ break;
+ }
+ xmlFree(exclusive);
+
// For COORM
xmlChar* launcher_args = xmlNodeGetContent(launcher_args_node);
new_job->setLauncherArgs(std::string((const char *)launcher_args));