HP-MPI User's Guide (11th Edition)

Example applications
ping_pong_ring.c (HP-UX and Linux)
Appendix A230
% export MPI_REMSH="rsh -x" (optional)
Then run
% $MPI_ROOT/bin/mpirun -prot -f appfile
% $MPI_ROOT/bin/mpirun -prot -f appfile -- 1000000
Or if LSF is being used, then the hostnames in the appfile wouldn't
matter, and the command to run would be
% bsub pam -mpi $MPI_ROOT/bin/mpirun -prot -f appfile
% bsub pam -mpi $MPI_ROOT/bin/mpirun -prot -f appfile \
-- 1000000
•The srun command is available
For this case then you would run a command like
% $MPI_ROOT/bin/mpirun -prot -srun -N 8 -n 8 /path/to/pp.x
% $MPI_ROOT/bin/mpirun -prot -srun -N 8 -n 8 /path/to/ \
pp.x 1000000
replacing "8" with the number of hosts.
Or if LSF is being used, then the command to run might be
% bsub -I -n 16 $MPI_ROOT/bin/mpirun -prot -srun \
/path/to/pp.x
% bsub -I -n 16 $MPI_ROOT/bin/mpirun -prot -srun \
/path/to/pp.x 1000000
•The prun command is available
This case is basically identical to the srun case with the obvious
change of using prun in place of srun.
In each case above, the first mpirun uses 0-bytes of data per message and
is for checking latency. The second mpirun uses 1000000 bytes per
message and is for checking bandwidth.
#include <stdio.h>
#include <stdlib.h>
#ifndef _WIN32
#include <unistd.h>
#endif
#include <string.h>
#include <math.h>
#include <mpi.h>