gemseo / wrappers / job_schedulers

Show inherited members

lsf module

Job schedulers interface for LSF.

class gemseo.wrappers.job_schedulers.lsf.LSF(discipline, workdir_path, scheduler_run_command='bsub -K', job_out_filename='batch.sh', job_template_path=None, use_template=True, setup_cmd='', user_email='', wall_time='24:00:00', ntasks=1, ntasks_per_node=1, mem_per_cpu='1G', **options)[source]

Bases: JobSchedulerDisciplineWrapper

A discipline that wraps the execution of the LSF 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 set up 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 (MDODiscipline) – 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 “bsub -K”.

  • 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

    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.

  • 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: AbstractCache | None

The cache containing one or several executions of the discipline according to the cache policy.

data_processor: DataProcessor

A tool to pre- and post-process discipline data.

exec_for_lin: bool

Whether the last execution was due to a linearization.

input_grammar: BaseGrammar

The input grammar.

jac: MutableMapping[str, MutableMapping[str, ndarray | csr_array | JacobianOperator]]

The Jacobians of the outputs wrt inputs.

The structure is {output: {input: matrix}}.

name: str

The name of the discipline.

output_grammar: BaseGrammar

The output grammar.

re_exec_policy: ReExecutionPolicy

The policy to re-execute the same discipline.

residual_variables: dict[str, str]

The output variables mapping to their inputs, to be considered as residuals; they shall be equal to zero.

run_solves_residuals: bool

Whether the run method shall solve the residuals.