Launching programs

The launch module handles launching of simulations/analyses as sub-processes, and obtaining information about the platform(s) on which the simulations are run.

copyright:

Copyright 2006-2020, 2024 by the Sumatra team, see doc/authors.txt

license:

BSD 2-clause, see LICENSE for details.

class sumatra.launch.SerialLaunchMode(working_directory=None, options=None)

Enable running serial computations.

check_files(executable, main_file)

Check that all files exist and are accessible.

generate_command(executable, main_file, arguments)

Return a string containing the command to be launched.

get_platform_information()

Return a list of PlatformInformation objects, containing information about the machine(s) and environment(s) the computations are being performed on/in.

get_type()
name = 'serial'
pre_run(executable)

Run tasks before the simulation/analysis proper.

required_attributes = ('check_files', 'generate_command')
run(executable, main_file, arguments, append_label=None, capture_stderr=True)

Run a computation in a shell, with the given executable, script and arguments. If append_label is provided, it is appended to the command line. Return resultcode.

class sumatra.launch.DistributedLaunchMode(n=1, mpirun='mpiexec', hosts=[], options=None, pfi_path='/usr/local/bin/pfi.py', working_directory=None)

Enable running distributed computations using MPI.

The current implementation is specific to MPICH2, but this will be generalised in future releases.

check_files(executable, main_file)

Check that all files exist and are accessible.

generate_command(executable, main_file, arguments)

Return a string containing the command to be launched.

get_platform_information()

Return a list of PlatformInformation objects, containing information about the machine(s) and environment(s) the computations are being performed on/in.

Requires the script pfi.py to be placed on the user’s path on each node of the machine.

This is currently not useful, as I don’t think there is any guarantee that we get the same n nodes that the command is run on. Need to look more into this.

get_type()
name = 'distributed'
pre_run(executable)

Run tasks before the simulation/analysis proper.

required_attributes = ('check_files', 'generate_command')
run(executable, main_file, arguments, append_label=None, capture_stderr=True)

Run a computation in a shell, with the given executable, script and arguments. If append_label is provided, it is appended to the command line. Return resultcode.

class sumatra.launch.PlatformInformation(**kwargs)

A simple container for information about the machine and environment the computations are being performed on/in.