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

◆ pb_zchekpad()

subroutine pb_zchekpad ( integer  ictxt,
character*(*)  mess,
integer  m,
integer  n,
complex*16, dimension( * )  a,
integer  lda,
integer  ipre,
integer  ipost,
complex*16  chkval 
)

Definition at line 9873 of file pzblastst.f.

9875*
9876* -- PBLAS test routine (version 2.0) --
9877* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
9878* and University of California, Berkeley.
9879* April 1, 1998
9880*
9881* .. Scalar Arguments ..
9882 INTEGER ICTXT, IPOST, IPRE, LDA, M, N
9883 COMPLEX*16 CHKVAL
9884* ..
9885* .. Array Arguments ..
9886 CHARACTER*(*) MESS
9887 COMPLEX*16 A( * )
9888* ..
9889*
9890* Purpose
9891* =======
9892*
9893* PB_ZCHEKPAD checks that the padding around a local array has not been
9894* overwritten since the call to PB_ZFILLPAD. Three types of errors are
9895* reported:
9896*
9897* 1) Overwrite in pre-guardzone. This indicates a memory overwrite has
9898* occurred in the first IPRE elements which form a buffer before the
9899* beginning of A. Therefore, the error message:
9900* 'Overwrite in pre-guardzone: loc( 5) = 18.00000'
9901* tells that the 5th element of the IPRE long buffer has been overwrit-
9902* ten with the value 18, where it should still have the value CHKVAL.
9903*
9904* 2) Overwrite in post-guardzone. This indicates a memory overwrite has
9905* occurred in the last IPOST elements which form a buffer after the end
9906* of A. Error reports are refered from the end of A. Therefore,
9907* 'Overwrite in post-guardzone: loc( 19) = 24.00000'
9908* tells that the 19th element after the end of A was overwritten with
9909* the value 24, where it should still have the value of CHKVAL.
9910*
9911* 3) Overwrite in lda-m gap. Tells you elements between M and LDA were
9912* overwritten. So,
9913* 'Overwrite in lda-m gap: A( 12, 3) = 22.00000'
9914* tells that the element at the 12th row and 3rd column of A was over-
9915* written with the value of 22, where it should still have the value of
9916* CHKVAL.
9917*
9918* Arguments
9919* =========
9920*
9921* ICTXT (local input) INTEGER
9922* On entry, ICTXT specifies the BLACS context handle, indica-
9923* ting the global context of the operation. The context itself
9924* is global, but the value of ICTXT is local.
9925*
9926* MESS (local input) CHARACTER*(*)
9927* On entry, MESS is a ttring containing a user-defined message.
9928*
9929* M (local input) INTEGER
9930* On entry, M specifies the number of rows in the local array
9931* A. M must be at least zero.
9932*
9933* N (local input) INTEGER
9934* On entry, N specifies the number of columns in the local ar-
9935* ray A. N must be at least zero.
9936*
9937* A (local input) COMPLEX*16 array
9938* On entry, A is an array of dimension (LDA,N).
9939*
9940* LDA (local input) INTEGER
9941* On entry, LDA specifies the leading dimension of the local
9942* array to be padded. LDA must be at least MAX( 1, M ).
9943*
9944* IPRE (local input) INTEGER
9945* On entry, IPRE specifies the size of the guard zone to put
9946* before the start of the padded array.
9947*
9948* IPOST (local input) INTEGER
9949* On entry, IPOST specifies the size of the guard zone to put
9950* after the end of the padded array.
9951*
9952* CHKVAL (local input) COMPLEX*16
9953* On entry, CHKVAL specifies the value to pad the array with.
9954*
9955*
9956* -- Written on April 1, 1998 by
9957* R. Clint Whaley, University of Tennessee, Knoxville 37996, USA.
9958*
9959* =====================================================================
9960*
9961* .. Local Scalars ..
9962 CHARACTER*1 TOP
9963 INTEGER I, IAM, IDUMM, INFO, J, K, MYCOL, MYROW, NPCOL,
9964 $ NPROW
9965* ..
9966* .. External Subroutines ..
9967 EXTERNAL blacs_gridinfo, igamx2d, pb_topget
9968* ..
9969* .. Intrinsic Functions ..
9970 INTRINSIC dble, dimag
9971* ..
9972* .. Executable Statements ..
9973*
9974* Get grid parameters
9975*
9976 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
9977 iam = myrow*npcol + mycol
9978 info = -1
9979*
9980* Check buffer in front of A
9981*
9982 IF( ipre.GT.0 ) THEN
9983 DO 10 i = 1, ipre
9984 IF( a( i ).NE.chkval ) THEN
9985 WRITE( *, fmt = 9998 ) myrow, mycol, mess, ' pre', i,
9986 $ dble( a( i ) ), dimag( a( i ) )
9987 info = iam
9988 END IF
9989 10 CONTINUE
9990 ELSE
9991 WRITE( *, fmt = * ) 'WARNING no pre-guardzone in PB_ZCHEKPAD'
9992 END IF
9993*
9994* Check buffer after A
9995*
9996 IF( ipost.GT.0 ) THEN
9997 j = ipre+lda*n+1
9998 DO 20 i = j, j+ipost-1
9999 IF( a( i ).NE.chkval ) THEN
10000 WRITE( *, fmt = 9998 ) myrow, mycol, mess, 'post',
10001 $ i-j+1, dble( a( i ) ),
10002 $ dimag( a( i ) )
10003 info = iam
10004 END IF
10005 20 CONTINUE
10006 ELSE
10007 WRITE( *, fmt = * )
10008 $ 'WARNING no post-guardzone buffer in PB_ZCHEKPAD'
10009 END IF
10010*
10011* Check all (LDA-M) gaps
10012*
10013 IF( lda.GT.m ) THEN
10014 k = ipre + m + 1
10015 DO 40 j = 1, n
10016 DO 30 i = k, k + (lda-m) - 1
10017 IF( a( i ).NE.chkval ) THEN
10018 WRITE( *, fmt = 9997 ) myrow, mycol, mess,
10019 $ i-ipre-lda*(j-1), j, dble( a( i ) ),
10020 $ dimag( a( i ) )
10021 info = iam
10022 END IF
10023 30 CONTINUE
10024 k = k + lda
10025 40 CONTINUE
10026 END IF
10027*
10028 CALL pb_topget( ictxt, 'Combine', 'All', top )
10029 CALL igamx2d( ictxt, 'All', top, 1, 1, info, 1, idumm, idumm, -1,
10030 $ 0, 0 )
10031 IF( iam.EQ.0 .AND. info.GE.0 ) THEN
10032 WRITE( *, fmt = 9999 ) info / npcol, mod( info, npcol ), mess
10033 END IF
10034*
10035 9999 FORMAT( '{', i5, ',', i5, '}: Memory overwrite in ', a )
10036 9998 FORMAT( '{', i5, ',', i5, '}: ', a, ' memory overwrite in ',
10037 $ a4, '-guardzone: loc(', i3, ') = ', g20.7, '+ i*',
10038 $ g20.7 )
10039 9997 FORMAT( '{', i5, ',', i5, '}: ', a, ' memory overwrite in ',
10040 $ 'lda-m gap: loc(', i3, ',', i3, ') = ', g20.7,
10041 $ '+ i*', g20.7 )
10042*
10043 RETURN
10044*
10045* End of PB_ZCHEKPAD
10046*
Here is the caller graph for this function: