When using the ch_p4 device, a number of command-line arguments may be used to control the behavior of the program.
If your configuration of mpich used -device=ch_p4, then some of the
p4 debugging capabilities are available to you. The most useful of
these are the command line arguments to the application program. Thus
mpirun -np 10 myprog -p4dbg 20 -p4rdbg 20results in program tracing information at a level of 20 being written to stdout during execution. For more information about what is printed at what levels, see the p4 Users' Guide [2].
If one specifies -p4norem on the command line, mpirun will not
actually
start the processes. The master process prints a message suggesting how the
user can do it. The point of this option is to enable the user to start the
remote processes under his favorite debugger, for instance. The option only
makes sense when processes are being started remotely, such as on a
workstation network. Note that this is an argument to the program, not
to mpirun. For example, to run myprog this way, use
mpirun -np 4 myprog -p4noremFor example, to run cpi with 2 processes, where the second process is run under the debugger, the session would look something like
mpirun -np 2 cpi -p4norem waiting for process on host shakey.mcs.anl.gov: /home/me/mpich/examples/basic/cpi sys2.foo.edu 38357 -p4amslaveon the first machine and
% gdb cpi GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-mandrake-linux"... (gdb) run sys2.foo.edu 38357 -p4amslave Starting program: /home/me/mpich/examples/basic/cpi sys2.foo.edu 38357 -p4amslave
By default, the working directory for processes running remotely with ch_p4 device is the same as that of the executable. To specify a different working directory, use -p4wdir as follows:
mpirun -np 4 myprog -p4wdir myrundir