August 15, 2012
These exercises provide basic and more advanced programming instruction for writing parallel programs calling SuperLU_DIST. A basic knowledge of C, parallel programming with message-passing, and MPI are assumed. Some of the exercises also require an understanding of two-dimensional block cyclic data distribution.
Detailed information on SuperLU may be found at the following URL:
2. Setup on carver.nersc.gov
After login to carver, you can access the SuperLU_DIST by typing:
% module load superlu_distAfter this, all the SuperLU related shell variables, library path, and include path are added into your environment. For example, the shell variable $SUPERLU_DIST_EXAMPLE is the directory containing all the examples.
% echo $SUPERLU_DIST_EXAMPLEshows the following path
/usr/common/acts/SuperLU/SuperLU_DIST/2.5/EXAMPLEYou can read the short help page by typing:
% module help superlu_distNow, you can copy all the examples in the $SUPERLU_DIST_EXAMPLE directory by doing the following in your home directory:
% mkdir SuperLU_DIST % cd SuperLU_DIST % cp -r $SUPERLU_DIST_EXAMPLE . % cd EXAMPLENow you can compile the programs by simply typing:
% makeThere is a README file in this directory, which gives you instructions on how to run these programs. For example, you can run pddrive on 4 cores as follows:
% qsub -I -V -q mag_acts -l nodes=1 (wait to get the node ...) % cd $PBS_O_WORKDIR % mpirun -np 4 ./pddrive -r 2 -c 2 big.rua
3. Anatomy of example pddrive.c
Five basic steps are required to call a SuperLU routine:
4. Fortran90 example FORTRAN/f_5x5.f90
At the SuperLU directory you just created, you can copy the Fortran90 examples as follows:
% cp -r /usr/common/acts/SuperLU/SuperLU_DIST/2.5/FORTRAN .Then, a subdirectory FORTRAN/ is created. Now you can compile the programs by:
% cd FORTRAN % makeThe README in this directory gives you instruction on how to run the programs.
The example f_5x5.f90 is the 5x5 matrix appeared in SuperLU Users' Guide,, Section 2.2:
[ s u u ] [ 19 21 21 ] [ l u ] [ 12 21 ] [ l p ] = [ 12 16 ] [ e u ] [ 5 21 ] [ l l r ] [ 12 12 18 ]It is set up to use 2 processors:
% qsub -I -V -q mag_acts -l nodes=1 (wait to get the node ...) % cd $PBS_O_WORKDIR % mpirun -np 2 ./f_5x5