main

MPIRun.exe

Use MPIRun.exe to launch an mpich application. It is in the [MPICH Simple Launcher Home]\bin directory. You will probably want to add this directory to your path environment variable.

Usage:

- MPIRun [flags] [-port LaunchPortNumber] configfile [args ...]
- MPIRun [flags] [-tcp] -localonly #processes executable [args ...]

flags
-env "var1=val1|var2=val2|var3=val3..."
-mpichport number (port number for the root process to listen on)

MPIRun parses the configuration file you provide to determine where to launch processes. The LaunchPortNumber argument tells mpirun which port to connect to to find the listening simple launcher shells on the remote hosts. If you don't provide this number the default is 2020. This port number is different from the port number in the configuration file. The port number in the configuration file is the port that the root process in the mpich job listens on for remote processes to connect to. These two port numbers must be different. If you don't provide a port number in the configuration file, the default is 12345. See the -mpichport option below.

Configuration files.

The config file format is as follows:

>     [port RootPortNumber]
>     exe c:\somepath\myapp.exe
>      OR \\host\share\somepath\myapp.exe
>     [args arg1 arg2 arg3 ...]
>     [env VAR1=VAL1|VAR2=VAL2|...|VARn=VALn]
>     hosts
>     hostA #procs
>     hostB #procs
>     hostC #procs
>     ...

Bracketed lines are optional. The # character will comment out a line

Here is a sample configuration file:

>     port 5500
>     exe c:\temp\mandel.exe
>     env MINX=0|MAXX=2|MINY=0|MAXY=2
>     args -i c:\temp\cool.points
>     hosts
>     fry 2
>     #light 2
>     jazz 1

Command line options for MPIRun

-localonly #procs

This runs the application on the local machine using the shared memory device.

-localonly #procs -tcp

Add the -tcp switch to force the use of sockets instead of shared memory

-env "var1=val1|var2=val2|var3=val3|...varn=valn"

This will set the environment variables specified in the string before each process is launched. Remember to quote the string so the command prompt doesn't interpret the vertical bar as a pipe command.

-mpichport number

For every mpich application, the root process waits on a specific port for the rest of the processes to connect. In order for two or more mpich applications to run at the same time from the same root host they must have unique ports to wait on. If you don't supply a number, the default is 12345. To run more than one application simultaneously, the user must supply unique port numbers. This number can be specified in the configuration file on the line: port number

How MPIRun launches processes

MPIRun makes socket connections to MPICHSH.exe running on each of the hosts specified in the configuration file (MPICHSH.exe must be manually started on each of the nodes before MPIRun.exe is called). MPICHSH.exe launches the processes and the output from each process is redirected over the socket. When the sockets close, the remote processes have terminated. MPIRun waits for all the sockets to close and then exits.

If you hit <Ctrl C> while MPIRun is running, it will exit - closing all the sockets. MPICHSH.exe terminates all processes running after the socket connection is lost.

This launcher is not secure. While the MPICHSH.exe processes are running, anyone can connect and launch a process. There is a slight bit of obscurity because the user can specify whatever port they want. The port supplied on the command line to MPIRun must be the same port that all the MPICHSH.exe processes are waiting on. If you don't provide a port number to either MPIRun or MPICHSH they default to port 2020.

main
MPIRun
MPICHSH