Download User`s Guide - Chasqueweb

Transcript
Using PIM in your application To use PIM with your application, link your program with
the .o le corresponding to the PIM iterative method routine being called and with the PIM
support library libpim.a.
4.4 Calling a PIM iterative method routine
With the exception of the Bi-CG, CGNR, CGNE and QMR methods, all the implemented
methods have the same parameter list as CG. The argument list for the double-precision implementation of the CG method is
SUBROUTINE PIMDCG(X,B,WRK,IPAR,DPAR,MATVEC,PRECONL,PRECONR,
+
PDSUM,PDNRM,PROGRESS)
and for Bi-CG (as well as for CGNR, CGNE and QMR)
SUBROUTINE PIMDBICG(X,B,WRK,IPAR,DPAR,MATVEC,TMATVEC,PRECONL,PRECONR,
PDSUM,PDNRM,PROGRESS)
+
where the parameters are as follows
Parameter Description
X
A vector of length IPAR(4)
On input, contains the initial estimate
On output, contains the last estimate computed
B
The right-hand-side vector of length IPAR(4)
WRK
A work vector used internally (see the description
of each routine for its length)
IPAR
An integer array containing input-output parameters
PAR
A oating-point array containing input-output parameters
MATVEC
Matrix-vector product external subroutine
TMATVEC
Transpose-matrix-vector product external subroutine
PRECONL
Left-preconditioning external subroutine
PRECONR
Right-preconditioning external subroutine
P SUM
Global sum (reduction) external function
P NRM
Vector norm external function
PROGRESS
Monitoring routine
Note in the example above that, contrary to the proposal in [5], PIM uses separate routines
to compute the matrix-vector and transpose-matrix-vector products. See the reference manual,
sections A.1 and A.2 for the description of the parameters above and the synopsis of the external
routine.
21