stilt.execution.SlurmExecutor#

class stilt.execution.SlurmExecutor(n_workers: 'int', cpus_per_task: 'int' = 1, array_parallelism: 'int | None' = None, setup: 'list[str] | None' = None, **kwargs: 'Any') → 'None'[source]#

Run receptors as a Slurm job array submitted with sbatch.

start() splits the receptor ids into one chunk file per array task under <project>/chunks/<batch>/, writes a submission script under <project>/slurm/, and submits it. Each task runs stilt push-worker on its chunk. The project must be a local directory.

Parameters

n_workersint

Number of array tasks.

cpus_per_taskint, default 1

CPUs per array task. With more than one, each task runs its receptors in a process pool of that size.

array_parallelismint, optional

Maximum number of array tasks running at once (the %N suffix of --array).

setuplist of str, optional

Shell commands to run before the worker, such as loading modules.

**kwargs

Other sbatch options, written as #SBATCH --key=value. Underscores in keys become hyphens, and True writes a bare flag.

Methods#

from_config(config)

Return an executor for a config's execution settings, which must set n_workers.

start(pending, *, project[, compute_root, ...])

Write the chunk files and submission script, submit it, and return a handle.

Attributes#

dispatch

n_workers

Number of array tasks.