thunderboltz.parallel.SlurmManager

class thunderboltz.parallel.SlurmManager(runner: MPRunner, directory=None, modules=['python', 'gcc'], mock=False, **options)[source]

A python context interface for the common Slurm HPC job manager to run more several intensive calculations on large clusters. See https://slurm.schedmd.com/sbatch.html.

Parameters:
  • runner (MPRunner) – The calculation runner.

  • directory (str or None) – the current working directory.

  • modules (list[str]) – A list of modules to be loaded by the HPC module system.

  • mock (bool) – Option to test scripts without calling a slurm manager.

  • **options – Additional keyword arguments will be interpreted as SLURM parameters.

Note

This job manager currently only works for clusters that either already have the gcc and python requirements installed on each compute node, or clusters that use the Module System to load functionality.

The default behavior is to accommodate the module system as it is common on most HPC machines. If you wish to avoid writing module load commands in the SLURM script, simply specify modules=[] in the constructor.

Attributes

directory

The simulation directory

modules

The list of modules to be loaded by the HPC module system.

runner

The MPRunner object.

job_ids

Store references to the slurm job numbers after jobs are submitted

options

The SLURM sbatch options

Methods

batch_script()

The SLURM job script.

has_active()

Check whether any submitted jobs are still pending or running.

has_pending()

Check whether any submitted jobs are still pending.

join()

Wait for all slurm jobs to finish.

mock_run()

Act as a compute node and test the job scripts sequentially.

process_batch_script()

Inspect the batch script below and process it for use in sbatch.

sbatch()

Call slurm with current settings.

set_(**options)

Update slurm manager options.

submit([run_args])

Add a set of parameter updates to the job queue.

write_slurm_script([path, script_name])

Write the SLURM batch script.