Skip to content

ARPACK

A collection of Fortran77 subroutines designed to solve large scale eigenvalue problems


The package is designed to compute a few eigenvalues and corresponding eigenvectors of a general n by n matrix A. It is most appropriate for large sparse or structured matrices A where structured means that a matrix-vector product w <- Av requires order n rather than the usual order n2 floating point operations. This software is based upon an algorithmic variant of the Arnoldi process called the Implicitly Restarted Arnoldi Method (IRAM). When the matrix A is symmetric it reduces to a variant of the Lanczos process called the Implicitly Restarted Lanczos Method (IRLM). These variants may be viewed as a synthesis of the Arnoldi/Lanczos process with the Implicitly Shifted QR technique that is suitable for large scale problems. For many standard problems, a matrix factorization is not required. Only the action of the matrix on a vector is needed.

Using ARPACK on the HPC cluster#

The parallel version of ARPACK is compiled for the GNU and Intel compilers, and for both openmpi and mvapich2 libraries.

The corresponding libraries are located in the following paths:

/opt/rcc/[gnu|intel]/[openmpi|mvapich2]/lib64

For example, to use libarpack.so and libarpack.so from the GNU OpenMPI Fortran compiler, add the following options to your compile executable:

 -L/opt/rcc/gnu/openmpi/lib64 -lparpack -larpack

Not that arpack is based upon the blas and lapack libraries, and parpack calls for arpack. Therefore, you have to link both the lapack and blas library packages and specify the path to these to packages depending on the compiler you are using.

For the GNU compiler, add the following options:

-L/usr/lib64 -lblas -llapack

For the Intel compiler, use the lapack and blas packages from the intel-mkl library:

-L/gpfs/research/software/intel/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -lmkl_blas95_lp64 -lmkl_lapack95_lp64

To run some simple examples provided by the ARPACK developers,

1
2
3
4
5
6
7
8
# copy serial and parallel examples to your home directories
$ cd $HOME
$ mkdir arpack
$ cd arpack  
$ mkdir SERIAL
$ mkdir PARALLEL
$ cp -r /opt/rcc/share/doc/arpack-doc/EXAMPLES SERIAL
$ cp -r /opt/rcc/share/doc/arpack-doc/MPI PARALLEL

Serial example#

Below is an example of compiling and running a serial program (sssimp.f, a serial f77 program) using the GNU compiler.

1
2
3
4
5
$ cd ~
$ cp /opt/rcc/share/doc/arpack-doc/EXAMPLES/SIMPLE/sssimp.f ~
$ module load gnu
$ gfortran sssimp.f -L/opt/rcc/gnu/lib64 -larpack -lblas -llapack  -o sssimp
$ ./sssimp

Parallel examples#

Below is an example of compiling and running a parallel program (pssdrv1.f) on the HPC using the GNU compiler.

1
2
3
4
$ cd ~
$ cp /opt/rcc/share/doc/arpack-doc/MPI/pssdrv1.f ~
$ module load gnu openmpi
$ mpif77 pssdrv1.f  -L/opt/rcc/gnu/openmpi/lib64 -larpack -lparpack -lblas -llapack  -o pssdrv1

If you want to use the Intel mvapich2 libraries with the pssdrv1.f code, run the commands:

 $ module load intel mvapich2
 $ mpif77 pssdrv1.f  -L/opt/rcc/intel/mvapich2/lib64 -larpack -lparpack -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -L/gpfs/research/software/intel/mkl/lib/intel64  -o pssdrv1

Example Slurm submit script#

Below is an example Slurm script named sub_parpack.sh to run the executable created with the above commands.

#!/bin/bash
#SBATCH --job-name="parpack_test"
#SBATCH -N 4
#SBATCH -p backfill
#SBATCH --mail-type="ALL"
#SBATCH -t 00:05:00

module purge
module load gnu openmpi

cd $SLURM_SUBMIT_DIR
mpirun -np 4 ./pssdrv1

You can submit this to the Slurm scheduler with the sbatch command:

$ sbatch sub_parpack.sh

You will see the following output after a successful job run:

_saupd: number of update iterations taken
-----------------------------------------
  1 -    1:     5

_saupd: number of "converged" Ritz values
-----------------------------------------
  1 -    1:     4

_saupd: final Ritz values
-------------------------
  1 -    4:   6.350E-01   3.985E-01   3.985E-01   1.620E-01

_saupd: corresponding error bounds
----------------------------------
1 -    4:   1.381E-13   8.283E-12   1.017E-10   3.955E-21

 ==========================================
 = Symmetric implicit Arnoldi update code =
 = Version Number: 2.1                    =
 = Version Date:   3/19/97               =
 ==========================================
 = Summary of timing statistics           =
 ==========================================

 Total number update iterations             =     5
 Total number of OP*x operations            =    81
 Total number of B*x operations             =     0
 Total number of reorthogonalization steps  =    81
 Total number of iterative refinement steps =     0
 Total number of restart steps              =     0
 Total time in user OP*x operation          =     0.001000
 Total time in user B*x operation           =     0.000000
 Total time in Arnoldi update routine       =     0.001999
 Total time in p_saup2 routine              =     0.001999
 Total time in basic Arnoldi iteration loop =     0.001999
 Total time in reorthogonalization phase    =     0.000000
 Total time in (re)start vector generation  =     0.000000
 Total time in trid eigenvalue subproblem   =     0.000000
 Total time in getting the shifts           =     0.000000
 Total time in applying the shifts          =     0.000000
 Total time in convergence testing          =     0.000000

 Ritz values and direct residuals
 --------------------------------
           Col   1       Col   2
Row   1:    1.62029E-01   1.44471E-06
Row   2:    3.98507E-01   1.35166E-06
Row   3:    3.98508E-01   1.75542E-06
Row   4:    6.34986E-01   1.71304E-06


 _SDRV1 
 ====== 

 Size of the matrix is          100
The number of processors is            4
The number of Ritz values requested is            4
The number of Arnoldi vectors generated (NCV) is           20
What portion of the spectrum: SM
The number of converged Ritz values is            4
The number of Implicit Arnoldi update iterations taken is            5
The number of OP*x is           81
The convergence criterion is   5.96046448E-08