NERSCPowering Scientific Discovery Since 1974

MPI Launch Overview

Overview

Open MPI provides the orterun command to launch MPI applications.  However, most people prefer to use one of two aliases:  mpirun or mpiexec.  For example, to launch 64 MPI tasks named example.x on Carver compute nodes, any of the following commands may be used:

carver% mpirun -np 64 ./example.x
carver% mpiexec -np 64 ./example.x
carver% orterun -np 64 ./example.x

For simplicity, all the examples in this section will use mpirun.

The application launch commands may only be issued from within the batch environment; no MPI applications may be executed on Carver's login nodes.

Options

The Open MPI application launcher provides many runtime options for task placement, debugging, and I/O.  Complete descriptions of these options are available on the Open MPI website, or via the command "man mpirun".  The following table summarizes a few of the more commonly used options.

Option Meaning
-v Produce verbose output.
-V Print version number.
-np num Run num copies of the application.
-npernode num Run num copies of the application on each node.
-bynode Launch processes one per node, cycling by node in a round-robin fashion.
-bycore Launch processes in a block manner, putting all on one node first and then the second (default)
-bind-to-core Bind processes to cores.
-stdin rank Direct stdin to process associated with MPI rank.
-tag-output Tag each line of stdout and stderr with [process_id,rank].
-timestamp-output Tag each line of stdout and stderr with timestamp.

Running Multi-Program Multi-Data (MPMD) Applications

Open MPI provides a simple mechanism to launch MPMD applications, using a colon to separate the components on the command line:

carver% mpirun -np 2 ./my_executable1 : -np 2 ./my_executable2

The above example will launch a single parallel application, but the first two processes will be instances of my_executable1, and the second two processes will be instances of my_executable2. In MPI terms, this will be a single MPI_COMM_WORLD, but the my_executable1 processes will be ranks 0 and 1, while the my_executable2 processes will be ranks 2 and 3.