Packages
Libraries
The following 64-bit libraries are built with the default
(MPI_IMPLEMENTATION=)openmpi and
(MPI_COMPILER=)pgi. Be sure to use the appropriate Portland Group
compiler to compile your own codes. Your batch script should also be set to
"openmpi" to run jobs.
- LAPACK
The Linear Algebra PACKage is a library of Fortran 77 subroutines for
solving the most commonly occurring problems in numerical linear algebra. To call
a routine in the package from a C/C++ program, append an underscore (_) to the
name of the routine. In addition, since FORTRAN passes variables by reference,
all scalar and array arguments must be passed as pointers.
- LAPACK is built under PGI. Use an
appropriate PGI compiler to compiler your code.
- To link against LAPACK, add "-lblas -llapack"
to your linking process.
- Calling LAPACK routines from a C code requires to link
additional libraries, -pgf77libs.
- Example. Solve Ax = b
- BLACS Basic Linear Algebra Communication Subprogram
- SCALAPACK
Scalable (parallel) LAPACK (Tutorial -- free, but requires registration)
BLACS routines are typically used for data decomposition
that feed into SCALAPACK subroutine calls. The following
library linking statements are required:
# Basic Linear Algebra Subroutine library
BLAS_LIB = -lblas
# BLACS lib (the first and last libs are intentionally identical)
BLACS_LIB = /project/scv/kadin/packages/BLACS_KATANA/LIB/blacs_MPI-KATANA-0.a \
/project/scv/kadin/packages/BLACS_KATANA/LIB/blacsCinit_MPI-KATANA-0.a \
/project/scv/kadin/packages/BLACS_KATANA/LIB/blacsF77init_MPI-KATANA-0.a \
/project/scv/kadin/packages/BLACS_KATANA/LIB/blacs_MPI-KATANA-0.a
# Scalapack lib
SCALAPACK_LIB = -L/project/scv/kadin/packages/SCALAPACK_KATANA -lscalapack
LIB = $(SCALAPACK_LIB) $(BLACS_LIB) $(BLAS_LIB)
myprog:
mpif90 -o myprog myprog.f90 $(LIB)
Prior to running the makefile, make sure that the pertinent environment
variables are those of the default settings:
katana:~ % setenv MPI_IMPLEMENTATION openmpi
katana:~ % setenv MPI_COMPILER pgi
The batch script for myprog should also be set to openmpi:
#!/bin/csh
#
# Example SGE script for running mpi jobs
#
# Submit job with the command: qsub script
#
. . .
setenv MPI_IMPLEMENTATION openmpi
. . .
mpirun -np $NSLOTS myprog
Applications
|
|
|