//! Name of the batch queue chosen - optional
string queue;
-
+
+ //! Name of the partition - optional
+ /*! It can be used only for slurm batch managers.
+ */
+ string partition;
+
//! Specifies if the job must run in exclusive mode (without sharing nodes with other jobs)
boolean exclusive;
long mem_mb;
//! required frequency
long cpu_clock;
- //! required number of nodes
+ //! required number of nodes. Can be used when submitting slurm jobs.
long nb_node;
//! required number of proc per node
long nb_proc_per_node;
_maximum_duration = "";
_maximum_duration_in_second = -1;
_queue = "";
+ _partition = "";
_job_type = "";
_exclusive = false;
_mem_per_cpu = 0;
_queue = queue;
}
+void
+Launcher::Job::setPartition(const std::string & partition)
+{
+ _partition = partition;
+}
+
void
Launcher::Job::setExclusive(bool exclusive)
{
return _queue;
}
+std::string
+Launcher::Job::getPartition() const
+{
+ return _partition;
+}
+
bool
Launcher::Job::getExclusive() const
{
params[Batch::NBPROC] = _resource_required_params.nb_proc;
params[Batch::NBPROCPERNODE] = _resource_required_params.nb_proc_per_node;
+ if(_resource_required_params.nb_node > 0)
+ params[Batch::NBNODE] = _resource_required_params.nb_node;
+
// Memory in megabytes
if (_resource_required_params.mem_mb > 0)
{
if (_queue != "")
params[Batch::QUEUE] = _queue;
+ // Partition
+ if (_partition != "")
+ params[Batch::PARTITION] = _partition;
+
// Exclusive
if (getExclusive())
params[Batch::EXCLUSIVE] = true;
void setMaximumDuration(const std::string & maximum_duration);
void setResourceRequiredParams(const resourceParams & resource_required_params);
void setQueue(const std::string & queue);
+ void setPartition(const std::string & partition);
void setEnvFile(const std::string & env_file);
void setExclusive(bool exclusive);
void setExclusiveStr(const std::string & exclusiveStr);
std::string getMaximumDuration() const;
resourceParams getResourceRequiredParams() const;
std::string getQueue() const;
+ std::string getPartition() const;
std::string getEnvFile() const;
std::string getJobType() const;
bool getExclusive() const;
long _maximum_duration_in_second;
resourceParams _resource_required_params;
std::string _queue;
+ std::string _partition;
bool _exclusive;
unsigned long _mem_per_cpu;
std::string _wckey;
addNode(node, "maximum_duration", job.getMaximumDuration());
if (!job.getQueue().empty())
addNode(node, "queue", job.getQueue());
+ if (!job.getPartition().empty())
+ addNode(node, "partition", job.getPartition());
if (job.getExclusive())
addNode(node, "exclusive", job.getExclusiveStr());
if (job.getMemPerCpu() > 0)
new_job->setMaximumDuration(getNodeContent(current_node));
else if (node_name == "queue")
new_job->setQueue(getNodeContent(current_node));
+ else if (node_name == "partition")
+ new_job->setPartition(getNodeContent(current_node));
else if (node_name == "exclusive")
new_job->setExclusiveStr(getNodeContent(current_node));
else if (node_name == "mem_per_cpu")
std::string queue = job_parameters.queue.in();
new_job->setQueue(queue);
+ // Partition
+ std::string partition = job_parameters.partition.in();
+ new_job->setPartition(partition);
+
// Exclusive
new_job->setExclusive(job_parameters.exclusive);
job_parameters->maximum_duration = CORBA::string_dup(job->getMaximumDuration().c_str());
job_parameters->queue = CORBA::string_dup(job->getQueue().c_str());
+ job_parameters->partition = CORBA::string_dup(job->getPartition().c_str());
job_parameters->exclusive = job->getExclusive();
job_parameters->mem_per_cpu = job->getMemPerCpu();
job_parameters->wckey = CORBA::string_dup(job->getWCKey().c_str());
class JobParameters (Engines.JobParameters):
def __init__(self, job_name="", job_type="", job_file="", pre_command="", env_file="", in_files=None, out_files=None,
work_directory="", local_directory="", result_directory="", maximum_duration="",
- resource_required=None, queue="", exclusive = False, mem_per_cpu = 0,
+ resource_required=None, queue="", partition="", exclusive = False, mem_per_cpu = 0,
wckey = "", extra_params = "",
specific_parameters=None, launcher_file = "", launcher_args = ""):
if in_files is None:
specific_parameters = []
Engines.JobParameters.__init__(self, job_name, job_type, job_file, pre_command, env_file, in_files, out_files,
work_directory, local_directory, result_directory, maximum_duration,
- resource_required, queue, exclusive, mem_per_cpu,
+ resource_required, queue, partition, exclusive, mem_per_cpu,
wckey, extra_params,
specific_parameters, launcher_file, launcher_args)