1 SUBROUTINE pzdtlaschk( 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
181 INTEGER BW, INFO, IPPRODUCT, WORK_MIN
182 DOUBLE PRECISION DIVISOR, EPS, RESID1, NORMX
187 EXTERNAL blacs_gridinfo, dgebr2d, dgebs2d,
189 $
pzmatgen, zgamx2d, zgemm, zgsum2d,
193 INTEGER IZAMAX, NUMROC
194 DOUBLE PRECISION PDLAMCH
195 EXTERNAL izamax, numroc, pdlamch
198 INTRINSIC abs, dble,
max,
min, mod
204 ictxt = desca( ctxt_ )
207 IF( lsame( symm,
'H' ) )
THEN
210 work_min =
max(5,nb)+2*nb
213 IF( lsame( uplo,
'D' ))
THEN
218 work_min =
max(5,nb)+2*nb
221 IF ( worksiz .LT. work_min )
THEN
222 CALL pxerbla( ictxt,
'PZTLASCHK', -18 )
226 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
228 eps = pdlamch( ictxt,
'eps' )
230 divisor = anorm * eps * dble( n )
232 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol, iia, jja,
234 CALL infog2l( ix, jx, descx, nprow, npcol, myrow, mycol, iix, jjx,
236 np = numroc( (3), desca( mb_ ), myrow, 0, nprow )
237 nq = numroc( n, desca( nb_ ), mycol, 0, npcol )
240 ipproduct = 1 + desca( nb_ )
241 ipw = 1 + 2*desca( nb_ )
247 IF( lsame( symm,
'H' ))
THEN
248 CALL pzbmatgen( ictxt, uplo,
'D', bw, bw, n, bw+1,
249 $ desca( nb_ ), a, desca( lld_ ), 0, 0,
250 $ iaseed, myrow, mycol, nprow, npcol )
253 CALL pzbmatgen( ictxt,
'N', uplo, bwl, bwu, n,
254 $ desca( mb_ ), desca( nb_ ), a,
255 $ desca( lld_ ), 0, 0, iaseed, myrow,
256 $ mycol, nprow, npcol )
264 IF( mycol.GT.0 )
THEN
265 CALL zgesd2d( ictxt, 1, 1, a( start+2), lda,
269 IF( mycol.LT.npcol-1 )
THEN
270 CALL zgesd2d( ictxt, 1, 1,
271 $ a( start+( desca( nb_ )-1 )*lda ),
272 $ lda, myrow, mycol+1 )
277 DO 220 i=0,desca( nb_ )-1
278 a( start+2+(i)*lda ) = a( start+2+(i+1)*lda )
281 DO 230 i=desca( nb_ )-1,0,-1
282 a( start+(i+1)*lda ) = a( start+(i)*lda )
287 IF( mycol.LT.npcol-1 )
THEN
288 CALL zgerv2d( ictxt, 1, 1,
289 $ a( start+2+( desca( nb_ )-1 )*lda ),
290 $ lda, myrow, mycol+1 )
293 IF( mycol.GT.0 )
THEN
294 CALL zgerv2d( ictxt, 1, 1, a( start), lda,
307 CALL pzgbdcmv( bwl+bwu+1, bwl, bwu, trans, n, a, 1, desca,
308 $ 1, x( 1 + (j-1)*descx( lld_ )), 1, descx,
309 $ work( ipproduct ), work( ipw ),
310 $ (int_one+2)*int_one, info )
315 CALL pzmatgen( descx( ctxt_ ),
'No',
'No', descx( m_ ),
316 $ descx( n_ ), descx( mb_ ), descx( nb_ ),
317 $ work( ipb ), descx( lld_ ), descx( rsrc_ ),
318 $ descx( csrc_ ), ibseed, 0, nq, j-1, 1, mycol,
319 $ myrow, npcol, nprow )
323 CALL pzaxpy( n, -one, work( ipproduct ), 1, 1, descx, 1,
324 $ work( ipb ), 1, 1, descx, 1 )
326 CALL pdznrm2( n, normx,
327 $ x, 1, j, descx, 1 )
329 CALL pdznrm2( n, resid1,
330 $ work( ipb ), 1, 1, descx, 1 )
335 resid1 = resid1 / ( normx*divisor )
337 resid =
max( resid, resid1 )