romtools.hpc.components.slurm#

Functions

create_slurm_script(job_name, num_nodes, ...)

Create a SLURM job script with the specified parameters.

is_slurm_exitcode(value)

Whether sacct gave us a code we can read; its columns are often blank.

parse_sbatch_out_args(script)

slurm_exitcode_to_python_style(exitcode)

romtools.hpc.components.slurm.create_slurm_script(job_name, num_nodes, tasks_per_node, wall_time, wcid, partition, command)[source]#

Create a SLURM job script with the specified parameters.

Parameters: - job_name: Name of the SLURM job - num_nodes: Number of nodes to request - tasks_per_node: Number of tasks to run on each node - wall_time: Maximum wall time for the job (format: HH:MM:SS) - wcid: The account to charge for the job - partition: The partition to submit the job to (“batch”, “short”) - command: The command to execute in the job

Returns: A string containing the SLURM job script.

Parameters:
  • job_name (str)

  • num_nodes (int)

  • tasks_per_node (int)

  • wall_time (str)

  • wcid (str)

  • partition (str)

  • command (str)

Return type:

str

romtools.hpc.components.slurm.is_slurm_exitcode(value)[source]#

Whether sacct gave us a code we can read; its columns are often blank.

Parameters:

value (str | None)

Return type:

bool