3 mpi parallelism, 4 modulefiles and mlib, 5 compiling and linking – HP XC System 2.x Software User Manual
Page 129: 1 linking veclib, 2 linking lapack, 3 linking scalapack
![background image](/manuals/398425/129/background.png)
9.3.3 MPI Parallelism
Internal parallelism in ScaLAPACK and SuperLU_DIST is implemented using MPI — a
portable, scalable programming model that gives distributed-memory parallel programmers a
simple and flexible interface for developing parallel applications.
9.3.4 Modulefiles and MLIB
When building or running an application built against MLIB, it is crucial that the environment is
consistent.
Modulefiles can make it easier to access a package. Therefore if modulefiles are used, it is
necessary to use a consistent set of modulefiles.
In particular, modulefiles can be used to select a compiler, both making its command available
in
$PATH
as well as making its shared objects available in
$LD_LIBRARY_PATH
.
MLIB has a modulefile corresponding to each supported compiler, making its shared objects
available in
$LD_LIBRARY_PATH
. If modulefiles are used to facilitate the user environment,
failure to use companion modulefiles will result in build and/or run-time errors.
If HP-MPI is used as well, it is important to make sure the
mpi**
compiler scripts use the
intended compiler. Do this by setting the appropriate environment variables, such as,
MPI_CC
and
MPI_F90
. Failure to do so may cause the compiler scripts to discover a compiler that is
not the intended compiler, and thus introduce an unintended inconsistency. It is important to
note that the MLIB modulefiles do not set any MPI environment variables.
For more information, refer to the MLIB User’s Guide.
9.3.5 Compiling and Linking
This section outlines compiling and linking information for HP XC MLIB libraries.
9.3.5.1 Linking VECLIB
For programs that link VECLIB, you can specify the entire path of the library file on the
compiler command line. You can use the following commands to link VECLIB:
$ pgf90 [options] file ...
/opt/mlib/pgi_5.1/hpmpi_2.1/lib/64/libveclib.a -mp
$ pgcc [options] file ...
/opt/mlib/pgi_5.1/hpmpi_2.1/lib/64/libveclib.a -mp -lpgf90
-lpgf90_rpml -lpgf902 -lpgf90rtl -lpgftnrtl
9.3.5.2 Linking LAPACK
For programs that link LAPACK, you can specify the entire path of the library file on the
compiler command line. You can use the following commands to link LAPACK:
$ pgf90 [options] file ...
/opt/mlib/pgi_5.1/hpmpi_2.1/lib/64/liblapack.a -mp
$ pgcc [options] file ...
/opt/mlib/pgi_5.1/hpmpi_2.1/lib/64/liblapack.a -mp -lpgf90
-lpgf90_rpml -lpgf902 -lpgf90rtl -lpgftnrtl
9.3.5.3 Linking ScaLAPACK
For programs that link ScaLAPACK, you can specify the entire path of the library file on the
compiler command line. You can use the following commands to link ScaLAPACK:
$ mpi90 [options] file ...
/opt/mlib/pgi_5.1/hpmpi_2.1/lib/64/libscalapack.a -mp
Using HP MLIB
9-5