runtraj.execution.runner.array_size#
- runtraj.execution.runner.array_size(block, n_releases, limit)[source]#
Return the number of tasks of a job array for n_releases:
n_tasks, or ten per worker.block is the
slurmorpbsblock. Never more than one task per release, nor more than limit, the most tasks the cluster allows in one array (Slurm’sMaxArraySize, PBS’smax_array_size). A task runscpusreleases at once, so withn_tasksunset a task’s share is whole rounds ofcpusreleases: a share of 10 on 8 CPUs would leave 6 of them idle for its last 2 releases.Examples
>>> from runtraj.execution import SlurmConfig >>> array_size(SlurmConfig(n_workers=50), 10_000, limit=1000) 500 >>> array_size(SlurmConfig(n_workers=50, cpus=8), 10_000, limit=1000) 417 >>> array_size(SlurmConfig(n_workers=200), 10_000, limit=1000) 1000 >>> array_size(SlurmConfig(n_workers=50), 120, limit=1000) 120
- Raises:
ValueError – If
n_tasksis more than limit.- Return type:
- Parameters:
block (SlurmConfig | PbsConfig)
n_releases (int)
limit (int)