1 SUBROUTINE pzdblaschk( SYMM, UPLO, TRANS, N, BWL, BWU, NRHS, X,
2 $ IX, JX, DESCX, IASEED, A, IA, JA, DESCA,
3 $ IBSEED, ANORM, RESID, WORK, WORKSIZ )
12 CHARACTER SYMM, TRANS, UPLO
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( * )
165 PARAMETER ( ONE = ( 1.0d+0, 0.0d+0 ),
166 $ zero = ( 0.0d+0, 0.0d+0 ) )
167 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
168 $ LLD_, MB_, M_, NB_, N_, RSRC_
169 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
170 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
171 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
173 PARAMETER ( INT_ONE = 1 )
176 INTEGER IACOL, IAROW, ICTXT,
177 $ IIA, IIX, IPB, IPW,
178 $ ixcol, ixrow, j, jja, jjx, lda,
179 $ mycol, myrow, nb, np, npcol, nprow, nq
180 INTEGER BW, INFO, IPPRODUCT, WORK_MIN
181 DOUBLE PRECISION DIVISOR, EPS, RESID1, NORMX
186 EXTERNAL blacs_gridinfo, dgebr2d, dgebs2d,
188 $
pzmatgen, zgamx2d, zgemm, zgsum2d,
192 INTEGER IZAMAX, NUMROC
193 DOUBLE PRECISION PDLAMCH
194 EXTERNAL izamax, numroc, pdlamch
197 INTRINSIC abs, dble,
max,
min, mod
203 ictxt = desca( ctxt_ )
206 IF( lsame( symm,
'H' ) )
THEN
208 work_min =
max(5,
max(
max(bwl,bwu)*(
max(bwl,bwu)+2),nb))+2*nb
211 work_min =
max(5,
max(
max(bwl,bwu)*(
max(bwl,bwu)+2),nb))+2*nb
214 IF ( worksiz .LT. work_min )
THEN
215 CALL pxerbla( ictxt,
'PZBLASCHK', -18 )
219 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
221 eps = pdlamch( ictxt,
'eps' )
223 divisor = anorm * eps * dble( n )
225 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
227 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
229 np = numroc( (bwl+bwu+1), desca( mb_ ), myrow, 0, nprow )
230 nq = numroc( n, desca( nb_ ), mycol, 0, npcol )
233 ipproduct = 1 + desca( nb_ )
234 ipw = 1 + 2*desca( nb_ )
240 IF( lsame( symm,
'H' ))
THEN
241 CALL pzbmatgen( ictxt, uplo,
'D', bw, bw, n, bw+1,
242 $ desca( nb_ ), a, desca( lld_ ), 0, 0,
243 $ iaseed, myrow, mycol, nprow, npcol )
246 CALL pzbmatgen( ictxt,
'N', uplo, bwl, bwu, n,
247 $ desca( mb_ ), desca( nb_ ), a,
248 $ desca( lld_ ), 0, 0, iaseed, myrow,
249 $ mycol, nprow, npcol )
261 CALL pzgbdcmv( bwl+bwu+1, bwl, bwu, trans, n, a, 1, desca,
262 $ 1, x( 1 + (j-1)*descx( lld_ )), 1, descx,
263 $ work( ipproduct ), work( ipw ),
264 $ (
max(bwl,bwu)+2)*
max(bwl,bwu), info )
269 CALL pzmatgen( descx( ctxt_ ),
'No',
'No', descx( m_ ),
270 $ descx( n_ ), descx( mb_ ), descx( nb_ ),
271 $ work( ipb ), descx( lld_ ), descx( rsrc_ ),
272 $ descx( csrc_ ), ibseed, 0, nq, j-1, 1, mycol,
273 $ myrow, npcol, nprow )
277 CALL pzaxpy( n, -one, work( ipproduct ), 1, 1, descx, 1,
278 $ work( ipb ), 1, 1, descx, 1 )
280 CALL pdznrm2( n, normx,
281 $ x, 1, j, descx, 1 )
283 CALL pdznrm2( n, resid1,
284 $ work( ipb ), 1, 1, descx, 1 )
289 resid1 = resid1 / ( normx*divisor )
291 resid =
max( resid, resid1 )