SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_dchekpad()

subroutine pb_dchekpad ( integer  ictxt,
character*(*)  mess,
integer  m,
integer  n,
double precision, dimension( * )  a,
integer  lda,
integer  ipre,
integer  ipost,
double precision  chkval 
)

Definition at line 9190 of file pdblastst.f.

9192*
9193* -- PBLAS test routine (version 2.0) --
9194* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
9195* and University of California, Berkeley.
9196* April 1, 1998
9197*
9198* .. Scalar Arguments ..
9199 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9200 DOUBLE PRECISION CHKVAL
9201* ..
9202* .. Array Arguments ..
9203 CHARACTER*(*) MESS
9204 DOUBLE PRECISION A( * )
9205* ..
9206*
9207* Purpose
9208* =======
9209*
9210* PB_DCHEKPAD checks that the padding around a local array has not been
9211* overwritten since the call to PB_DFILLPAD. Three types of errors are
9212* reported:
9213*
9214* 1) Overwrite in pre-guardzone. This indicates a memory overwrite has
9215* occurred in the first IPRE elements which form a buffer before the
9216* beginning of A. Therefore, the error message:
9217* 'Overwrite in pre-guardzone: loc( 5) = 18.00000'
9218* tells that the 5th element of the IPRE long buffer has been overwrit-
9219* ten with the value 18, where it should still have the value CHKVAL.
9220*
9221* 2) Overwrite in post-guardzone. This indicates a memory overwrite has
9222* occurred in the last IPOST elements which form a buffer after the end
9223* of A. Error reports are refered from the end of A. Therefore,
9224* 'Overwrite in post-guardzone: loc( 19) = 24.00000'
9225* tells that the 19th element after the end of A was overwritten with
9226* the value 24, where it should still have the value of CHKVAL.
9227*
9228* 3) Overwrite in lda-m gap. Tells you elements between M and LDA were
9229* overwritten. So,
9230* 'Overwrite in lda-m gap: A( 12, 3) = 22.00000'
9231* tells that the element at the 12th row and 3rd column of A was over-
9232* written with the value of 22, where it should still have the value of
9233* CHKVAL.
9234*
9235* Arguments
9236* =========
9237*
9238* ICTXT (local input) INTEGER
9239* On entry, ICTXT specifies the BLACS context handle, indica-
9240* ting the global context of the operation. The context itself
9241* is global, but the value of ICTXT is local.
9242*
9243* MESS (local input) CHARACTER*(*)
9244* On entry, MESS is a ttring containing a user-defined message.
9245*
9246* M (local input) INTEGER
9247* On entry, M specifies the number of rows in the local array
9248* A. M must be at least zero.
9249*
9250* N (local input) INTEGER
9251* On entry, N specifies the number of columns in the local ar-
9252* ray A. N must be at least zero.
9253*
9254* A (local input) DOUBLE PRECISION array
9255* On entry, A is an array of dimension (LDA,N).
9256*
9257* LDA (local input) INTEGER
9258* On entry, LDA specifies the leading dimension of the local
9259* array to be padded. LDA must be at least MAX( 1, M ).
9260*
9261* IPRE (local input) INTEGER
9262* On entry, IPRE specifies the size of the guard zone to put
9263* before the start of the padded array.
9264*
9265* IPOST (local input) INTEGER
9266* On entry, IPOST specifies the size of the guard zone to put
9267* after the end of the padded array.
9268*
9269* CHKVAL (local input) DOUBLE PRECISION
9270* On entry, CHKVAL specifies the value to pad the array with.
9271*
9272*
9273* -- Written on April 1, 1998 by
9274* R. Clint Whaley, University of Tennessee, Knoxville 37996, USA.
9275*
9276* =====================================================================
9277*
9278* .. Local Scalars ..
9279 CHARACTER*1 TOP
9280 INTEGER I, IAM, IDUMM, INFO, J, K, MYCOL, MYROW, NPCOL,
9281 $ NPROW
9282* ..
9283* .. External Subroutines ..
9284 EXTERNAL blacs_gridinfo, igamx2d, pb_topget
9285* ..
9286* .. Executable Statements ..
9287*
9288* Get grid parameters
9289*
9290 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
9291 iam = myrow*npcol + mycol
9292 info = -1
9293*
9294* Check buffer in front of A
9295*
9296 IF( ipre.GT.0 ) THEN
9297 DO 10 i = 1, ipre
9298 IF( a( i ).NE.chkval ) THEN
9299 WRITE( *, fmt = 9998 ) myrow, mycol, mess, ' pre', i,
9300 $ a( i )
9301 info = iam
9302 END IF
9303 10 CONTINUE
9304 ELSE
9305 WRITE( *, fmt = * ) 'WARNING no pre-guardzone in PB_DCHEKPAD'
9306 END IF
9307*
9308* Check buffer after A
9309*
9310 IF( ipost.GT.0 ) THEN
9311 j = ipre+lda*n+1
9312 DO 20 i = j, j+ipost-1
9313 IF( a( i ).NE.chkval ) THEN
9314 WRITE( *, fmt = 9998 ) myrow, mycol, mess, 'post',
9315 $ i-j+1, a( i )
9316 info = iam
9317 END IF
9318 20 CONTINUE
9319 ELSE
9320 WRITE( *, fmt = * )
9321 $ 'WARNING no post-guardzone buffer in PB_DCHEKPAD'
9322 END IF
9323*
9324* Check all (LDA-M) gaps
9325*
9326 IF( lda.GT.m ) THEN
9327 k = ipre + m + 1
9328 DO 40 j = 1, n
9329 DO 30 i = k, k + (lda-m) - 1
9330 IF( a( i ).NE.chkval ) THEN
9331 WRITE( *, fmt = 9997 ) myrow, mycol, mess,
9332 $ i-ipre-lda*(j-1), j, a( i )
9333 info = iam
9334 END IF
9335 30 CONTINUE
9336 k = k + lda
9337 40 CONTINUE
9338 END IF
9339*
9340 CALL pb_topget( ictxt, 'Combine', 'All', top )
9341 CALL igamx2d( ictxt, 'All', top, 1, 1, info, 1, idumm, idumm, -1,
9342 $ 0, 0 )
9343 IF( iam.EQ.0 .AND. info.GE.0 ) THEN
9344 WRITE( *, fmt = 9999 ) info / npcol, mod( info, npcol ), mess
9345 END IF
9346*
9347 9999 FORMAT( '{', i5, ',', i5, '}: Memory overwrite in ', a )
9348 9998 FORMAT( '{', i5, ',', i5, '}: ', a, ' memory overwrite in ',
9349 $ a4, '-guardzone: loc(', i3, ') = ', g20.7 )
9350 9997 FORMAT( '{', i5, ',', i5, '}: ', a, ' memory overwrite in ',
9351 $ 'lda-m gap: loc(', i3, ',', i3, ') = ', g20.7 )
9352*
9353 RETURN
9354*
9355* End of PB_DCHEKPAD
9356*
Here is the caller graph for this function: