ezpz.launch
ΒΆ
Execution helpers for launching distributed jobs.
ezpz/launch.py
Launch a command on the current PBS or SLURM job.
By default, the command to be executed will be launched across all nodes.
build_executable(launch_cmd=None, cmd_to_launch=None, include_python=False, ngpus=None, nhosts=None, ngpu_per_host=None, hostfile=None)
ΒΆ
Build the full executable command to launch.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
launch_cmd
|
str
|
The command to launch the job. If None,
will be built using |
None
|
cmd_to_launch
|
str or list
|
The command to run on the job.
If None, will be taken from |
None
|
include_python
|
bool
|
Whether to include the python executable in the command. Defaults to False. |
False
|
Returns:
Name | Type | Description |
---|---|---|
str |
list
|
The full command to launch the job. |
Source code in src/ezpz/launch.py
command_exists(cmd)
ΒΆ
configure_warnings()
ΒΆ
Silence noisy deprecation warnings for child processes.
Source code in src/ezpz/launch.py
get_active_jobid()
ΒΆ
Return the job identifier for the currently running PBS/SLURM job.
Source code in src/ezpz/launch.py
get_aurora_filters(additional_filters=None)
ΒΆ
Return log filtering patterns tailored for Aurora clusters.
Source code in src/ezpz/launch.py
get_command_to_launch_from_argv()
ΒΆ
Return the command specified on sys.argv
or None
if absent.
Source code in src/ezpz/launch.py
get_hostfile_of_active_job()
ΒΆ
Get hostfile of active job.
Source code in src/ezpz/launch.py
get_nodelist_of_active_job()
ΒΆ
Get nodelist of active job.
Source code in src/ezpz/launch.py
get_scheduler()
ΒΆ
kill_existing_processes(filters=None, additional_filters=None)
ΒΆ
Kill existing processes that match the filters.
Source code in src/ezpz/launch.py
launch(launch_cmd=None, cmd_to_launch=None, include_python=False, ngpus=None, nhosts=None, ngpu_per_host=None, hostfile=None, filters=None)
ΒΆ
Launch a command on the current {PBS, SLURM} job.
Source code in src/ezpz/launch.py
main()
ΒΆ
CLI entry point for ezpz-launch
with local mpirun
fallback.
Source code in src/ezpz/launch.py
parse_args()
ΒΆ
Parse command line arguments.
Source code in src/ezpz/launch.py
run_bash_command(command)
ΒΆ
Execute a bash command and capture its output.
run_command(command, filters=None)
ΒΆ
Run a command and print its output line by line.
Args:
- command (str or list): The command to run. If a string, it will be split into a list
- filters (list, optional): A list of strings to filter the output lines.