Newsgroups: comp.parallel.pvm
From: djb1@ukc.ac.uk (Dave Beckett)
Subject: Re: BLAS under PVM
Organization: University of Kent at Canterbury
Date: Mon, 15 Aug 94 10:28:40 GMT
Message-ID: <123@nutmeg.ukc.ac.uk>

>>>>> About "BLAS under PVM", Eamonn said:
In article <ecahill-100894195544@ec.hdl.ie> ecahill@hdl.ie (Eamonn Cahill) writes:
Eamonn> Can anyone tell me if there is a public domain parallel BLAS-like
Eamonn> library implmented on PVM?
Eamonn>
Eamonn> Thanks for any help,
amonn>
Eamonn> Eamonn Cahill Hitachi Dublin Laboratory, Trinity College, Dublin
Eamonn> 2,Ireland Ph: +353-1-6798911, Fax: +353-1-6798926, Internet:
Eamonn> ecahill@hdl.ie

The PIM library described below may be of use.  It runs on networks of
workstations using PVM 3.1, p4 1.2, TCGMSG 4.02, on the Intel Paragon using
the NX library and on the Cray Y-MP2E/233. and was written by Rudnei Dias
da and Tim Hopkins.

Get it from /pub/misc/netlib/pib/pim.tar.Z on unix.hensa.ac.uk

Dave
------
PIM 1.1  
Parallel Iterative Methods package for Systems of Linear Equations  
(Fortran 77 version) 
--------------------------------------------------------------------------------

Rudnei Dias da Cunha 
  Centro de Processamento de Dados, Universidade Federal do Rio Grande do Sul,
    Brasil
  Computing Laboratory, University of Kent at Canterbury, United Kingdom

Tim Hopkins 
  Computing Laboratory, University of Kent at Canterbury, United Kingdom
 
--

INTRODUCTION
The Parallel Iterative Methods (PIM) is a collection of Fortran routines
designed to solve systems of linear equations (SLEs) on parallel computers
using iterative methods.

PIM offers a number of iterative methods, including 
  - Conjugate-Gradients (CG), 
  - Bi-Conjugate-Gradients (Bi-CG), 
  - Conjugate-Gradients squared (CGS),
  - The stabilised version of Bi-Conjugate-Gradients (Bi-CGSTAB),
  - Generalised minimal residual (GMRES),
  - Generalised conjugate residual (GCR),
  - Conjugate-Gradients for normal equations with minimisation of the
    residual norm (CGNR),
  - Conjugate-Gradients for normal equations with minimisation of the
    error norm (CGNE), and
  - Transpose-free quasi-minimal residual (TFQMR).

The routines allow the use of preconditioners; the user may choose to use
left-, right- or symmetric-preconditioning. Several stopping criteria can also
be chosen.

PIM was developed with two main goals
  1. To allow the user complete freedom with respect to the matrix storage,
access and partitioning; 
  2. To achieve portability across a variety of parallel architectures
and programming environments. 

These goals are achieved by hiding from the PIM routines the specific details
concerning the computation of the following three linear algebra operations
  1. Matrix-vector (and transpose-matrix-vector) product 
  2. Preconditioning step 
  3. Inner-product and vector norm 

PIM has been tested on networks of workstations using PVM 3.1, p4 1.2, 
TCGMSG 4.02, on the Intel Paragon using the NX library and on the 
Cray Y-MP2E/233.


INSTALLATION
Please read the file "Copyright" for the conditions of use.

The current distribution contains
 1. The PIM routines in the directories "single", "double", "complex" and
    "dcomplex"
 2. A set of example programs in the directories "examples/sequential",
    "examples/pvm", "examples/p4", "examples/paragon" and "examples/tcgmsg", 
 3. A users' guide in compressed PostScript format in the "doc" directory. 

After "untaring" the file "pim.tar", change directory to ~/pim and edit the
Makefile. The following variables may need to be modified

   HOME      Your top directory, e.g. /u1/users/fred  
   FC        Your Fortran compiler of choice, usually f77  
   FFLAGS    Flags for the Fortran compilation of main programs
             (example programs)
   OFFLAGS   Flags for the Fortran compilation of separate
             modules (PIM routines and modules of examples);
             MUST contain at least flag for separate compilation 
             (usually -c)
   AR        The archiver program, usually ar  
   HASRANLIB Either t (true) or f (false), indicating if it is
             necessary to use a random library program (usually 
             ranlib) to build the PIM library
   BLASLIB   The command switches for the library containing the 
             BLAS routines; for instance, if a library libblas.a 
             is installed in a system-wide basis, then set BLASLIB
             to -lblas
   PARLIB    The compilation switches for the parallel libraries. This 
             variable should be left blank if PIM is to be used in 
             sequential mode. For example, if p4 1.2 has been installed 
             in the user's area, then PARLIB  would be defined as
             -L $(HOME)/p4-1.2/lib -lp4 -L $(HOME)/p4-1.2/lib -lp4 
 
Before building PIM, you may need to edit either the file
~/pim/single/lib/smachcons.f or ~/pim/double/lib/dmachcons.f and replace the
value of the variable SMACHEPS or DMACHEPS respectively with the single- or
double- precision value of the machine epsilon of the particular computer you
are using. The distribution source codes provide these values for machines that
use the IEEE-754 floating-point standard.

The occurrence of stagnation is detected considering the current and the
previous 3 iterations. If this criterion is not good for your application, edit
either the file ~/pim/single/lib/scheckconv.f or ~/pim/double/lib/dcheckconv.f,
and replace the value of the parameter MAXSTAGCNT with the number of previous
iterations to be considered.

To build PIM, type    

  make makefiles  

to build the makefiles in the appropriate directories and then 

  make single
or 
  make double 
or
  make complex
or
  make dcomplex

to build the single-precision, double-precision, complex or double complex
versions of PIM. This will generate .o files, one for each iterative method
routine and also libpim.a which contains the support routines.

The example programs are in the directories

   examples/sequential/single/dense  
   examples/sequential/single/pde  
   examples/sequential/single/harwell-boeing  

   examples/sequential/double/dense  
   examples/sequential/double/pde  
   examples/sequential/double/harwell-boeing  

   examples/sequential/complex/dense  

   examples/sequential/dcomplex/dense  


   examples/pvm/single/dense  
   examples/pvm/single/pde  

   examples/pvm/double/dense  
   examples/pvm/double/pde  

   examples/pvm/complex/dense  

   examples/pvm/dcomplex/dense  


   examples/p4/single/dense  
   examples/p4/single/pde  

   examples/p4/double/dense  
   examples/p4/double/pde  

   examples/p4/complex/dense  

   examples/p4/dcomplex/dense  


   examples/tcgmsg/double/dense  
   examples/tcgmsg/double/pde  

   examples/tcgmsg/dcomplex/dense  


   examples/paragon/single/dense  
   examples/paragon/single/pde  

   examples/paragon/double/dense  
   examples/paragon/double/pde  

   examples/paragon/complex/dense  

   examples/paragon/dcomplex/dense  
 

Before building the examples, edit the file examples/common/timer.f and modify
it to use the timing function available in your machine.  Examples are provided
in the source file for the Cray, IBM RS/6000 and the UNIX etime function. By
default, the latter is used.

To build the examples, type make followed by the name of a subdirectory of
examples , e.g.

  make sequential/single/dense 

The example programs can also be built locally in those directories by
changing to a specific directory and typing make.

Please read the file ~/pim/examples/Readme for more information.

CLEANING UP
The object files in the single, double, complex, dcomplex and examples 
directories can be cleaned by typing

  make singleclean
or
  make doubleclean
or
  make complexclean
or
  make dcomplexclean
or
  make examplesclean

The same can be obtained by typing

  make realclean


USING PIM
To use PIM with your application, link your program with the .o  file
corresponding to the PIM iterative method routine being called and with the PIM
support library libpim.a .

USING THE BLAS
Some systems offer highly optimised versions of the BLAS which you are
encouraged to use for better performance. If the system you are using
does not have the BLAS available, you can retrieve the routines from
the many sites running NETLIB. The BLAS routines that will be needed
for the PIM routines are
  SSCAL/DSCAL/CSCAL/ZSCAL
  SCOPY/DCOPY/CCOPY/ZCOPY
  SAXPY/DAXPY/CAXPY/ZAXPY
  SDOT/DDOT/CDOTC/ZDOTC
  STRSV/DTRSV/CTRSV/ZTRSV

and for the examples you will need
  SNRM2/DNRM2/SCNRM2/DZNRM2
  SGEMV/DGEMV/CGEMV/ZGEMV
  LSAME
  XERBLA

You may compile these and generate a library called libblas.a using
the following commands
  f77 -O -c *.f
  ar rcv libblas.a *.o
  ranlib libblas.a
  rm *.o

Notes:
  - Replace f77 for the Fortran compiler of your choice 
  - Some systems use a different archiver program instead of ar
  - Some systems do not require the use of ranlib

COMMENTS/SUGGESTIONS
The authors can be contacted via e-mail at either rdd@ukc.ac.uk or trh@ukc.ac.uk

 

