Running an MPI Program

The easiest way to run an MPI program is using the mpirun command:

  $ mpirun -n <# of processes> ./myprog

This command invokes the mpiexec.hydra command which uses the Hydra Process Manager by default. Use the mpiexec.hydra options on the mpirun command line.

Note

The commands mpirun and mpiexec.hydra are interchangeable. You are recommended to use the mpirun command to run Intel MPI programs for the following reasons:

  1. You can specify all mpiexec.hydra options with the mpirun command.
  2. The mpirun command detects if the MPI job is submitted from within a session allocated using a job scheduler like PBS Pro* or LSF*. Thus, you are recommended to use the mpirun command when an Intel MPI program is running under batch schedulers or job managers.

Use the -n option to set the number of MPI processes. If the -n option is not specified, the process manager pulls the host list from a job scheduler, or uses the number of cores on the machine.

By default, the ssh protocol is used for communication between nodes. If you are using rsh instead, use -r rsh option:

  $ mpirun -r rsh -n <# of processes> ./myprog

For a successful run, configure password-less ssh connections for all nodes. For more details, see the Job Startup Commands topic in Intel® MPI Library Reference Manual for Linux* OS.

After you successfully run your application using the Intel® MPI Library, you can move your application from one cluster to another and use different fabrics between the nodes without re-linking. If you encounter problems, see Debugging and Testing for possible solutions.