Parallel Programming Guide for HP-UX Systems

MPI
Compiling and Linking
Chapter 2 21
The user-defined callback passed to these functions should accept normal-sized arguments.
These functions are called internally by the library where normally-sized data types will be
passed to them.
64-bit support
HP-UX 11.i and higher is available as a 32- and 64-bit operating system. You must run 64-bit
executables on the 64-bit system (though you can build 64-bit executables on the 32-bit
system).
HP MPI supports a 64-bit version of the MPI library on platforms running HP-UX 11.i and
higher. Both 32- and 64-bit versions of the library are shipped with HP-UX 11i and higher. For
HP-UX 11i and higher, you cannot mix 32-bit and 64-bit executables in the same application.
The mpicc and mpiCC compilation commands link the 64-bit version of the library if you
compile with the +DA2.0W or +DD64 options. Use the following syntax:
[mpicc | mpiCC] [+DA2.0W | +DD64] -o filename filename.c
When you use mpif90, compile with the +DA2.0W option to link the 64-bit version of the
library. Otherwise, mpif90 links the 32-bit version. For example, to compile the program
myprog.f90 and link the 64-bit library enter:
% mpif90 +DA2.0W -o myprog myprog.f90
Thread-compliant library
HP MPI provides a thread-compliant library. By default, the non thread-compliant library
(libmpi) is used when running HP MPI jobs. Linking to the thread-compliant library
(libmtmpi) is now required only for applications that have multiple threads making MPI calls
simultaneously. In previous releases, linking to the thread-compliant library was required for
multithreaded applications even if only one thread was making a MPI call at a time.
Application types that no longer require linking to the thread-compliant library include:
Implicit compiler-generated parallelism (e.g. +O3 +Oparallel in HP-UX)
Thread parallel MLIB applications
OpenMP
pthreads (Only if no two threads call MPI at the same time. Otherwise, use the
thread-compliant library for pthreads.)