Parallel Programming Guide for HP-UX Systems

MPI
Debugging
Chapter 2 63
Fortran 90 programming features The MPI 1.1 standard defines bindings for Fortran 77
but not Fortran 90.
Although most Fortran 90 MPI applications work using the Fortran 77 MPI bindings, some
Fortran 90 features can cause unexpected behavior when used with HP MPI.
In Fortran 90, an array is not always stored in contiguous memory. When noncontiguous
array data are passed to an HP MPI subroutine,
Fortran 90 copies the data into temporary storage, passes it to the HP MPI subroutine, and
copies it back when the subroutine returns. As a result, HP MPI is given the address of the
copy but not of the original data.
In some cases, this copy-in and copy-out operation can cause a problem. For a nonblocking HP
MPI call, the subroutine returns immediately and the temporary storage is deallocated. When
HP MPI tries to access the already invalid memory, the behavior is unknown. Moreover, HP
MPI operates close to the system level and needs to know the address of the original data.
However, even if the address is known, HP MPI does not know if the data are contiguous or
not.
UNIX open file descriptors UNIX imposes a limit to the number of file descriptors that
application processes can have open at one time. When running a multihost application, each
local process opens a socket to each remote process. An HP MPI application with a large
amount of off-host processes can quickly reach the file descriptor limit. Ask your system
administrator to increase the limit if your applications frequently exceed the maximum.
External input and output You can use stdin, stdout, and stderr in your applications to
read and write data. By default, HP MPI does not perform any processing on either stdin or
stdout. The controlling tty determines stdio behavior in this case.
HP MPI does provide optional stdio processing features. stdin can be targeted to a particular
process, or can be broadcast to every process. stdout processing includes buffer control,
prepending MPI rank numbers, and combining repeated output.
HP MPI standard IO options can be set by using the following options to mpirun:
mpirun -stdio=[bline[
#
] | bnone[
#
] | b[#], [p], [r[
#
]], [i[#]]
where
i Broadcasts standard input to all MPI processes.
i
[#]
Directs standard input to the process with global rank #.
The following modes are available for buffering:
b
[#>0]
Specifies that the output of a single MPI process is placed to the standard
out of mpirun after # bytes of output have been accumulated.