Product specifications

Table Of Contents
5–Using QLogic MPI
QLogic MPI Details
IB6054601-00 H 5-5
A
fpi.f is a Fortran 77 program that computes pi in a way similar to cpi.c.
Compile and link, and run it as follows:
$ mpif77 -o fpi fpi.f
$ mpirun -np 2 -m mpihosts ./fpi
pi3f90.f90
is a Fortran 90 program that does the same computation. Compile
and link, and run it as follows:
$ mpif90 -o pi3f90 pi3f90.f90
$ mpirun -np 2 -m mpihosts ./pi3f90
The C++ program hello++.cc is a parallel processing version of the traditional
“Hello, World” program. Notice that this version makes use of the external C
bindings of the MPI functions if the C++ bindings are not present.
Compile and run it as follows:
$ mpicxx -o hello hello++.cc
$ mpirun -np 10 -m mpihosts ./hello
Hello World! I am 9 of 10
Hello World! I am 2 of 10
Hello World! I am 4 of 10
Hello World! I am 1 of 10
Hello World! I am 7 of 10
Hello World! I am 6 of 10
Hello World! I am 3 of 10
Hello World! I am 0 of 10
Hello World! I am 5 of 10
Hello World! I am 8 of 10
Each of the scripts invokes the GNU compiler for the respective language and the
linker. See “To Use Another Compiler” on page 5-8 for an example of how to use
other compilers. The use of mpirun is the same for programs in all languages.
QLogic MPI Details
The following sections provide more details on the use of QLogic MPI. These
sections assume that you are familiar with standard MPI. For more information,
see the references in “References for MPI” on page G-1. This implementation
includes the man pages from the MPICH implementation for the numerous MPI
functions.