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

◆ pb_cchekpad()

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

Definition at line 9871 of file pcblastst.f.

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