mlrl.testbed_slurm.sbatch module

Author: Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes that allow to run “sbatch” commands.

class mlrl.testbed_slurm.sbatch.Sbatch

Bases: SlurmCommand

Allows to run “sbatch” commands.

script(path: Path) Sbatch

Sets an absolute or relative path to a batch script that defines the job to be run.

version() Sbatch

Sets the “–version” flag.

Returns:

The object itself

class mlrl.testbed_slurm.sbatch.SlurmCommand(command: str)

Bases: ABC

An abstract base class for all Slurm commands.

class Result(exit_code: int, output: str)

Bases: object

The result of a Slurm command.

Attributes:

exit_code: The exit code of the command output: The stdout or stderr output of the command

exit_code: int
property ok: bool

True, if the command terminated with a zero exit code, False otherwise.

output: str
run() Result

Runs the command.

Returns:

The result of the command