A job, either wrench::StandardJob
or wrench::PilotJob
, can be submitted to a wrench::BatchComputeService
by a call to the wrench::JobManager::submitJob()
method. However, it is required to pass to it a service-specific argument. This argument is a std::map<std::string, std::string>
of key-value pairs, and must have the following three elements:
- key:
-t
; value: a requested runtime in minutes that, if exceeded, causes forceful job termination (e.g., "60"); - key:
-N
; value: a requested number of compute nodes (e.g., "2"); and - key:
-c
; value: a requested number of cores per compute nodes (e.g., "4").
You may note that the above corresponds to the arguments that must be provided to the Slurm batch scheduler.
Here is an example job submission to the batch service:
If the service-specific arguments are invalid (e.g., number of nodes too large), wrench::JobManager::submitJob()
method throws a wrench::WorkflowExecutionException
.
See the WMS implementation in examples/basic-examples/batch-bag-of-tasks/TwoTasksAtATimeBatchWMS.cpp
for a more complete example.
A batch compute service also supports pilot jobs. Once started, a pilot job exposes a temporary (only running until its containing pilot job expires) bare-metal compute service. Here is a simple code excerpt:
While the pilot job is running, standard jobs can be submitted to its bare-metal service.
See the WMS implementation in examples/basic-examples/basic-examples/batch-pilot-job/PilotJobWMS.cpp
for a more complete example.