1 SUBROUTINE pzpblaschk( SYMM, UPLO, N, BWL, BWU, NRHS, X, IX, JX,
2 $ DESCX, IASEED, A, IA, JA, DESCA, IBSEED,
3 $ ANORM, RESID, WORK, WORKSIZ )
13 INTEGER BWL, BWU, IA, IASEED, IBSEED,
14 $ ix, ja, jx, n, nrhs, worksiz
15 DOUBLE PRECISION ANORM, RESID
18 INTEGER DESCA( * ), DESCX( * )
19 COMPLEX*16 A( * ), WORK( * ), X( * )
162 PARAMETER ( ONE = ( 1.0d+0, 0.0d+0 ),
163 $ zero = ( 0.0d+0, 0.0d+0 ) )
164 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
165 $ LLD_, MB_, M_, NB_, N_, RSRC_
166 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
167 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
168 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
170 PARAMETER ( INT_ONE = 1 )
173 INTEGER IACOL, IAROW, ICTXT,
174 $ IIA, IIX, IPB, IPW,
175 $ ixcol, ixrow, j, jja, jjx, lda,
176 $ mycol, myrow, nb, np, npcol, nprow, nq
177 INTEGER BW, INFO, IPPRODUCT, WORK_MIN
178 DOUBLE PRECISION DIVISOR, EPS, RESID1, NORMX
183 EXTERNAL blacs_gridinfo, dgebr2d, dgebs2d,
185 $
pzmatgen, zgamx2d, zgemm, zgsum2d,
189 INTEGER IZAMAX, NUMROC
190 DOUBLE PRECISION PDLAMCH
191 EXTERNAL izamax, numroc, pdlamch
194 INTRINSIC abs, dble,
max,
min, mod
200 ictxt = desca( ctxt_ )
203 IF( lsame( symm,
'H' ) )
THEN
205 work_min =
max(5,
max(bw*(bw+2),nb))+2*nb
208 work_min =
max(5,
max(bw*(bw+2),nb))+2*nb
211 IF ( worksiz .LT. work_min )
THEN
212 CALL pxerbla( ictxt,
'PZBLASCHK', -18 )
216 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
218 eps = pdlamch( ictxt,
'eps' )
220 divisor = anorm * eps * dble( n )
222 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
224 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
226 np = numroc( (bw+1), desca( mb_ ), myrow, 0, nprow )
227 nq = numroc( n, desca( nb_ ), mycol, 0, npcol )
230 ipproduct = 1 + desca( nb_ )
231 ipw = 1 + 2*desca( nb_ )
237 IF( lsame( symm,
'H' ))
THEN
238 CALL pzbmatgen( ictxt, uplo,
'D', bw, bw, n, bw+1,
239 $ desca( nb_ ), a, desca( lld_ ), 0, 0,
240 $ iaseed, myrow, mycol, nprow, npcol )
243 CALL pzbmatgen( ictxt,
'N', uplo, bwl, bwu, n,
244 $ desca( mb_ ), desca( nb_ ), a,
245 $ desca( lld_ ), 0, 0, iaseed, myrow,
246 $ mycol, nprow, npcol )
258 CALL pzpbdcmv( bw+1, bw, uplo, n, a, 1, desca,
259 $ 1, x( 1 + (j-1)*descx( lld_ )), 1, descx,
260 $ work( ipproduct ), work( ipw ), (bw+2)*bw, info )
265 CALL pzmatgen( descx( ctxt_ ),
'No',
'No', descx( m_ ),
266 $ descx( n_ ), descx( mb_ ), descx( nb_ ),
267 $ work( ipb ), descx( lld_ ), descx( rsrc_ ),
268 $ descx( csrc_ ), ibseed, 0, nq, j-1, 1, mycol,
269 $ myrow, npcol, nprow )
273 CALL pzaxpy( n, -one, work( ipproduct ), 1, 1, descx, 1,
274 $ work( ipb ), 1, 1, descx, 1 )
276 CALL pdznrm2( n, normx,
277 $ x, 1, j, descx, 1 )
279 CALL pdznrm2( n, resid1,
280 $ work( ipb ), 1, 1, descx, 1 )
285 resid1 = resid1 / ( normx*divisor )
287 resid =
max( resid, resid1 )