mache.parallel.system.ParallelSystem.get_parallel_command
- ParallelSystem.get_parallel_command(args: List[str], ntasks: int, cpus_per_task: int = 0, gpus_per_task: int = 0, placement: ResourcePlacement | None = None, memory_cap: int | None = None) List[str][source]
Get the parallel execution command for the current system.
- Parameters:
args (list of str) – The command-line arguments for the parallel execution.
ntasks (int) – The total number of tasks to run in parallel.
cpus_per_task (int, optional) – The number of CPUs to allocate per task.
gpus_per_task (int, optional) – The number of GPUs to allocate per task. Ignored when
placementis given, which expresses GPUs as a total for the launch instead.placement (mache.parallel.ResourcePlacement, optional) –
Which nodes, cores and GPUs to confine this launch to, for callers running several launches at once inside one allocation. When it is not given, the command is exactly what it would have been without this argument.
A placement supersedes the machine’s
distribution,placement,gpu_bindandmem_bindconfig options, which describe how to spread a launch over a whole node.memory_cap (int, optional) –
The most memory, in MB, this launch may use on each node it runs on. Absent by default, in which case nothing about memory is rendered and the launch may use whatever the node has.
It is a cap, not a reservation. Nothing measured suggests it sets memory aside, so a launch that stays under its cap is not protected from a concurrent one that does not. It is rendered only where the batch system will act on it; check
memory_cap_supportto find out whether this machine is one of those.The unit and the per-node denomination match
memory_per_node, which is the figure a caller divides up between the launches it runs at once.
- Returns:
command (list of str) – The complete command to execute the parallel job.