HP-MPI User's Guide (11th Edition)
Understanding HP-MPI
Compilation wrapper script utilities
Chapter 346
HP-MPI offers a -show option to compiler wrappers. When compiling by
hand, run as mpicc -show and a line will print displaying exactly what
the job was going to do (and skips the actual build).
Fortran 90
In order to use the 'mpi' Fortran 90 module, the user must create the
module file by compiling the module.F file in
/opt/hpmpi/include/64/module.F for 64-bit compilers. For 32-bit
compilers, compile the module.F file in
/opt/hpmpi/include/32/module.F.
NOTE Each vendor (e.g. PGI, Qlogic/Pathscale, Intel, Gfortran, etc.) has a
different module file format. Since compiler implementations vary in
their representation of a module file, a PGI module file is not usable with
Intel and so on. Additionally, we cannot guarantee forward compatibility
from older to newer versions of a specific vendor's compiler. Because of
compiler version compatibility and format issues, we do not build the
module files.
In each case, you will need to build (just once) the module that
corresponds to 'mpi' with the compiler you intend to use.
For example, with hpmpi/bin and pgi/bin in path:
pgf90 -c /opt/hpmpi/include/64/module.F
cat >hello_f90.f90 program main
use mpi
implicit none
integer :: ierr, rank, size
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, rank, ierr)
call MPI_COMM_SIZE(MPI_COMM_WORLD, size, ierr)
print *, "Hello, world, I am ", rank, " of ", size
call MPI_FINALIZE(ierr)
End
mpif90 -mpif90 pgf90 hello_f90.f90
hello_f90.f90:
mpirun ./a.out
Hello, world, I am 0 of 1