csdms

wmtexe.launcher module

Classes to configure and launch jobs from a wmt-exe environment.

class wmtexe.launcher.BashLauncher(sim_id, server_url=None, launch_dir='~/.wmt', extra_args=[])[source]

Bases: wmtexe.launcher.Launcher

WMT job launcher for a bash environment.

Methods

after_launch(**kwds) Perform actions after launching job.
after_success(**kwds) Perform actions after job completes.
before_launch(**kwds) Perform actions before launching job.
launch(**kwds) Launch job with launch command.
launch_command(**kwds) The command that runs a job.
prepend_path() Places the bin directory of executor at the front of the path.
run(**kwds) Perform job setup, launch, and teardown actions.
script(**kwds) Generate the launch script.
slave_command([extra_args]) Create the wmt-slave command.
prepend_path()[source]

Places the bin directory of executor at the front of the path.

script(**kwds)[source]

Generate the launch script.

Parameters:

*kwds

Arbitrary keyword arguments.

Returns:

str

The launch script to be written to a file.

class wmtexe.launcher.Launcher(sim_id, server_url=None, launch_dir='~/.wmt', extra_args=[])[source]

Bases: object

Job launcher for a wmt-exe environment.

Parameters:

sim_id : str

A unique UUID for the job.

server_url : str or None, optional

The URL of the WMT API server from which the job was submitted.

launch_dir : str, optional

The working directory from which the job is started.

extra_args : list, optional

Extra arguments to be passed to the wmt-slave command.

Attributes

launch_dir (str) The working directory from which the job is started.
script_path (str) Path to launch script.
sim_id (str) A unique UUID for the job.
server_url (str or None) The URL of the WMT API server from which the job was submitted.

Methods

after_launch(**kwds) Perform actions after launching job.
after_success(**kwds) Perform actions after job completes.
before_launch(**kwds) Perform actions before launching job.
launch(**kwds) Launch job with launch command.
launch_command(**kwds) The command that runs a job.
run(**kwds) Perform job setup, launch, and teardown actions.
script(**kwds) Generate the launch script.
slave_command([extra_args]) Create the wmt-slave command.
after_launch(**kwds)[source]

Perform actions after launching job.

Parameters:

**kwds

Arbitrary keyword arguments.

after_success(**kwds)[source]

Perform actions after job completes.

Parameters:

**kwds

Arbitrary keyword arguments.

before_launch(**kwds)[source]

Perform actions before launching job.

Parameters:

**kwds

Arbitrary keyword arguments.

launch(**kwds)[source]

Launch job with launch command.

Parameters:

**kwds

Arbitrary keyword arguments.

launch_command(**kwds)[source]

The command that runs a job.

Parameters:

**kwds

Arbitrary keyword arguments.

Returns:

str

The launch command to execute.

run(**kwds)[source]

Perform job setup, launch, and teardown actions.

Parameters:

**kwds

Arbitrary keyword arguments.

script(**kwds)[source]

Generate the launch script.

Parameters:

*kwds

Arbitrary keyword arguments.

Returns:

str

The launch script to be written to a file.

slave_command(extra_args=None)[source]

Create the wmt-slave command.

Parameters:

extra_args : str, optional

Additional arguments.

Returns:

str

The slave command to execute.

class wmtexe.launcher.QsubLauncher(sim_id, server_url=None, launch_dir='~/.wmt', extra_args=[])[source]

Bases: wmtexe.launcher.Launcher

WMT job launcher for a PBS scheduler.

Methods

after_launch(**kwds) Perform actions after launching job.
after_success(**kwds) Perform actions after job completes.
before_launch(**kwds) Perform actions before launching job.
launch(**kwds) Launch job with launch command.
launch_command(**kwds) Path to launch script.
run(**kwds) Perform job setup, launch, and teardown actions.
script(**kwds) Generate the launch script.
slave_command([extra_args]) Create the wmt-slave command.
launch_command(**kwds)[source]

Path to launch script.

Parameters:

**kwds

Arbitrary keyword arguments.

Returns:

str

The launch command to execute.

class wmtexe.launcher.SbatchLauncher(*args, **kwds)[source]

Bases: wmtexe.launcher.Launcher

WMT job launcher for a Slurm scheduler.

Parameters:

sim_id : str

A unique UUID for the job.

server_url : str or None, optional

The URL of the WMT API server from which the job was submitted.

launch_dir : str, optional

The working directory from which the job is started.

extra_args : list, optional

Extra arguments to be passed to the wmt-slave command.

Attributes

launch_dir (str) The working directory from which the job is started.
script_path (str) Path to launch script.
run_script_path (str) Path to run script, which submits launch script to scheduler.
sim_id (str) A unique UUID for the job.
server_url (str or None) The URL of the WMT API server from which the job was submitted.

Methods

after_launch(**kwds) Perform actions after launching job.
after_success(**kwds) Perform actions after job completes.
before_launch(**kwds) Perform actions before launching job.
launch(**kwds) Launch job with launch command.
launch_command(**kwds) The command that runs a job.
run(**kwds) Perform job setup, launch, and teardown actions.
run_script(**kwds) Generate the run script that submits job to scheduler.
script(**kwds) Generate the launch script.
slave_command([extra_args]) Create the wmt-slave command.
before_launch(**kwds)[source]

Perform actions before launching job.

Parameters:

**kwds

Arbitrary keyword arguments.

launch(**kwds)[source]

Launch job with launch command.

Note that we override Launcher.launch because we want to inherit the environment from the current process.

Parameters:

**kwds

Arbitrary keyword arguments.

launch_command(**kwds)[source]

The command that runs a job.

Parameters:

**kwds

Arbitrary keyword arguments.

Returns:

str

The launch command to execute.

run_script(**kwds)[source]

Generate the run script that submits job to scheduler.

Parameters:

*kwds

Arbitrary keyword arguments.

Returns:

str

The run script to be written to a file.