mpirun -np 5 myprog -p4pg pgfile
where pfile is the name of the file. The file format is defined below.
This is necessary when you want closer control over the hosts you will run on,
or when mpirun cannot construct it automatically. Such is the case
when
<hostname> <#procs> <progname> [<login>]So an example of such a file, where the command is being issued from host sun1, might be
sun1 0 /users/jones/myprog
sun2 1 /users/jones/myprog
sun3 1 /users/jones/myprog
hp1 1 /home/mbj/myprog mbj
The above file specifies four processes, one each of three suns and one on
another workstation where the user's account name is different. Note the
0 in the first line. It is there to indicate that no other
processes are to be started on host sun1 than the one started by the
user by his command.
You might want to run all the processes on your own machine, just as a test. You can do this just by repeating its name in the file:
sun1 0 /users/jones/myprog
sun1 1 /users/jones/myprog
sun1 1 /users/jones/myprog
Will run three processes on sun1, communicating via sockets.
To run on a shared-memory multiprocessor, with 10 processes, you would use a file like
sgimp 9 /u/me/prog
Note that this is for 10 processes, 1 of them started by the user directly,
and the other 9 specified in this file.
If you are logged into host gyrfalcon and want to start a job with one process on gyrfalcon and three processes on alaska, where the alaska processes communicate through shared memory, you would use
local 0 /home/jbg/main
alaska 3 /afs/u/graphics