gemseo.disciplines.wrappers.job_schedulers.slurm module#

SLURM interface.

class SLURM(discipline, workdir_path, scheduler_run_command='sbatch --wait', job_out_filename='batch.sh', job_template_path=None, use_template=True, setup_cmd='', user_email='', wall_time='24:00:00', ntasks=1, cpus_per_task=1, nodes_number=1, ntasks_per_node=1, mem_per_cpu='1G', **options)[source]#

Bases: JobSchedulerDisciplineWrapper

A discipline that wraps the execution of the SLURM Job scheduler.

The discipline is serialized to the disk, its input too, then a job file is created from a template to execute it with the provided options. The submission command is launched, it will setup the environment, deserialize the discipline and its inputs, execute it and serialize the outputs. Finally, the deserialized outputs are returned by the wrapper.

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • discipline (Discipline) -- The discipline to wrap in the job scheduler.

  • workdir_path (Path) -- The path to the workdir where the files will be generated.

  • scheduler_run_command (str) --

    The command to call the job scheduler and submit the generated script.

    By default it is set to "sbatch --wait".

  • job_out_filename (str) --

    The output job file name.

    By default it is set to "batch.sh".

  • job_template_path (Path | str | None) -- The path to the template to be used to make a submission to the job scheduler command.

  • use_template (bool) --

    whether to use template based interface to the job scheduler.

    By default it is set to True.

  • setup_cmd (str) --

    The command used before running the executable.

    By default it is set to "".

  • user_email (str) --

    The user email to send the run status.

    By default it is set to "".

  • wall_time (str) --

    The wall time.

    By default it is set to "24:00:00".

  • ntasks (int) --

    The number of tasks.

    By default it is set to 1.

  • cpus_per_task (int) --

    The number of CPUS per task.

    By default it is set to 1.

  • nodes_number (int) --

    The number nodes.

    By default it is set to 1.

  • ntasks_per_node (int) --

    The number of tasks per node.

    By default it is set to 1.

  • mem_per_cpu (str) --

    The memory per CPU.

    By default it is set to "1G".

  • **options (dict[str:Any]) -- The job scheduler specific options to be used in the template.

Raises:

OSError -- If job_template_path does not exist.

cache: BaseCache | None#

The execution and linearization data saved according to the cache type.

execution_statistics: ExecutionStatistics#

The execution statistics of the process.

execution_status: ExecutionStatus#

The execution status of the process.

jac: JacobianData#

The Jacobian matrices of the outputs.

The structure is {output_name: {input_name: jacobian_matrix}}.

name: str#

The name of the process.