hbp_nrp_distributed_nest.launch.MPILauncher module

Helper class to build and execute a formatted mpirun command in the format:

mpirun -envlist <vars> -np <proc> -host <hostname/ip> -wdir <temporary work dir> <command> : …

where each of the hosts has a specific working directory with necessary config files already in place. Also passes environment variables required for NRP/CLE execution.

class MPILauncher(executable)[source]

Bases: object

Class constructs and executes the mpi launch command.

add_host(hostname, tmpdir, processes=1)[source]

Add a target host to the mpi launch configuration.

Parameters
  • hostname – The remote host name or ip.

  • tmpdir – A valid temporary directory on the remote host to launch in.

  • processes – The number of processes for this host.

build()[source]

Construct the mpirun command line string with all hosts provided.

launch()[source]

Launch the mpirun command and wait for successful startup of the CLE. Blocks until the CLE publishes completion on the status topic or if the mpirun command aborts.

run()[source]

Block until the mpirun command exits. Check the return code to determine if it was successful or aborted. Backwards compatibility in naming convention, must be run.

shutdown()[source]

Attempt to forecfully shutdown the mpirun command if it is still running and has not cleanly shut itself down. Guaranteed to be called after launch success or failure.