Compilers from GNU, Intel and PGI provide a -pthreadswitch to allow compilation with the Pthread library.

Packages that link against Pthreads, such as MKL and MLIB, require that the application is linked using the -pthreadoption. The Pthread option is invoked with the following compiler-specific switches:

GNU -pthread

Intel -pthread

PGI -lpgthread

For example:

$ mpicc object1.o ... -pthread -o myapp.exe

3.7.1.5 Quadrics SHMEM

The Quadrics implementation of SHMEM is supported on HP XC systems with Quadrics switches. SHMEM is a collection of high-performance routines (that support a distributed-memory model) for data passing between parallel executables.

To compile programs that use SHMEM, it is necessary to include the shmem.h file and to use the SHMEM and Elan libraries. For example:

$ gcc -o shping shping.c -lshmem -lelan

3.7.1.6 MLIB Math Library

The HP MLIB mathematical library is included in the HP XC System Software and is installed by default.

HP MLIB contains mathematical software and computational kernels for engineering and scientific applications involving linear equations, least squares, eigenvalue problems, singular value decomposition, vector and matrix computations, convolutions, and Fourier Transforms. This release of HP XC MLIB has four components: VECLIB, LAPACK, ScaLAPACK, and SuperLU_DIST.

You must install the Intel compilers for the 64-bit architecture, or PGI compilers for XC4000, in order to use the HP XC MLIB mathematical library. See your system administrator if the required compilers are not installed on your system.

Information about using HP MLIB is provided in Chapter 9. An HP XC MLIB Product Overview and User’s Guide are available on the HP XC Documentation CD-ROM.

3.7.1.7 MPI Library

The MPI library supports MPI 1.2 as described in the 1997 release of MPI: A Message Passing Interface Standard. Users should note that the MPI specification describes the application programming interface, but does not specify the contents of the MPI header files, mpi.h and mpif.h, that are included in the source code. Therefore, an MPI application must be recompiled using the proper header files for the MPI library to which it is to be linked.

Parallel applications that use MPI for communication must include the HP XC infrastructure libraries. MPI applications must be built with mpicc, mpic++, mpif77, or mpif90 utilities.

When an MPI application is launched, the user environment, including any MPI environment variables that have been set, is passed to the application.

MPI profiling support is included in the HP XC MPI library, so you do not need to link with a separate library to access the PMPI_xxx() versions of the MPI routines.

3-6Developing Applications