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

◆ cchkpad()

subroutine cchkpad ( character*1  uplo,
character*1  diag,
integer  m,
integer  n,
complex, dimension(*)  mem,
integer  lda,
integer  rsrc,
integer  csrc,
integer  myrow,
integer  mycol,
integer  ipre,
integer  ipost,
complex  checkval,
integer  testnum,
integer  maxerr,
integer  nerr,
integer, dimension(6, maxerr)  erribuf,
complex, dimension(2, maxerr)  errdbuf 
)

Definition at line 9869 of file blacstest.f.

9872*
9873* -- BLACS tester (version 1.0) --
9874* University of Tennessee
9875* December 15, 1994
9876*
9877*
9878* .. Scalar Arguments ..
9879 CHARACTER*1 UPLO, DIAG
9880 INTEGER M, N, LDA, RSRC, CSRC, MYROW, MYCOL, IPRE, IPOST
9881 INTEGER TESTNUM, MAXERR, NERR
9882 COMPLEX CHECKVAL
9883* ..
9884* .. Array Arguments ..
9885 INTEGER ERRIBUF(6, MAXERR)
9886 COMPLEX MEM(*), ERRDBUF(2, MAXERR)
9887* ..
9888*
9889* Purpose
9890* =======
9891* CCHKPAD: Check padding put in by PADMAT.
9892* Checks that padding around target matrix has not been overwritten
9893* by the previous point-to-point or broadcast send.
9894*
9895* Arguments
9896* =========
9897* UPLO (input) CHARACTER*1
9898* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
9899* rectangular?
9900*
9901* DIAG (input) CHARACTER*1
9902* For trapezoidal matrices, is the main diagonal included
9903* ('N') or not ('U')?
9904*
9905* M (input) INTEGER
9906* The number of rows of the matrix A. M >= 0.
9907*
9908* N (input) INTEGER
9909* The number of columns of the matrix A. N >= 0.
9910*
9911* MEM (input) complex array, dimension(IPRE+IPOST+LDA*N).
9912* Memory location IPRE elements in front of the matrix A.
9913*
9914* LDA (input) INTEGER
9915* The leading dimension of the array A. LDA >= max(1, M).
9916*
9917* RSRC (input) INTEGER
9918* The process row of the source of the matrix.
9919*
9920* CSRC (input) INTEGER
9921* The process column of the source of the matrix.
9922*
9923* MYROW (input) INTEGER
9924* Row of this process in the process grid.
9925*
9926* MYCOL (input) INTEGER
9927* Column of this process in the process grid.
9928*
9929* IPRE (input) INTEGER
9930* The size of the guard zone before the start of A.
9931*
9932* IPOST (input) INTEGER
9933* The size of guard zone after A.
9934*
9935* CHECKVAL (input) complex
9936* The value to pad matrix with.
9937*
9938* TESTNUM (input) INTEGER
9939* The number of the test being checked.
9940*
9941* MAXERR (input) INTEGER
9942* Max number of errors that can be stored in ERRIBUFF or
9943* ERRCBUFF
9944*
9945* NERR (output) INTEGER
9946* The number of errors that have been found.
9947*
9948* ERRIBUF (output) INTEGER array, dimension (6,MAXERRS)
9949* Buffer in which to store integer error information. It will
9950* be built up in the following format for the call to TSEND.
9951* All integer information is recorded in the following 6-tuple
9952* {TESTNUM, SRC, DEST, I, J, WHAT}. These values are figured:
9953* SRC = RSRC * NPROCS + CSRC
9954* DEST = RDEST * NPROCS + CDEST
9955* WHAT
9956* = 1 : Error in pre-padding
9957* = 2 : Error in post-padding
9958* = 3 : Error in LDA-M gap
9959* = 4 : Error in complementory triangle
9960* ELSE: Error in matrix
9961* If there are more errors than can fit in the error buffer,
9962* the error number will indicate the actual number of errors
9963* found, but the buffer will be truncated to the maximum
9964* number of errors which can fit.
9965*
9966* ERRDBUF (output) @(doctype) array, dimension (2, MAXERRS)
9967* Buffer in which to store error data information.
9968* {Incorrect, Predicted}
9969*
9970* ===================================================================
9971*
9972* .. Parameters ..
9973 INTEGER ERR_PRE, ERR_POST, ERR_GAP, ERR_TRI, ERR_MAT
9974 parameter( err_pre = 1, err_post = 2, err_gap = 3, err_tri = 4 )
9975 parameter( err_mat = 5 )
9976* ..
9977* .. External Functions ..
9978 INTEGER IBTNPROCS
9979 EXTERNAL ibtnprocs
9980* ..
9981* .. Local Scalars ..
9982 LOGICAL ISTRAP
9983 INTEGER I, J, K, IRST, IRND, ICST, ICND, SRC, DEST
9984 INTEGER NPROCS
9985* ..
9986* .. Executable Statements ..
9987*
9988 nprocs = ibtnprocs()
9989 src = rsrc * nprocs + csrc
9990 dest = myrow * nprocs + mycol
9991*
9992* Check buffer in front of A
9993*
9994 IF( ipre .GT. 0 ) THEN
9995 DO 10 i = 1, ipre
9996 IF( mem(i) .NE. checkval ) THEN
9997 nerr = nerr + 1
9998 IF( nerr .LE. maxerr ) THEN
9999 erribuf(1, nerr) = testnum
10000 erribuf(2, nerr) = src
10001 erribuf(3, nerr) = dest
10002 erribuf(4, nerr) = i
10003 erribuf(5, nerr) = ipre - i + 1
10004 erribuf(6, nerr) = err_pre
10005 errdbuf(1, nerr) = mem(i)
10006 errdbuf(2, nerr) = checkval
10007 END IF
10008 END IF
10009 10 CONTINUE
10010 END IF
10011*
10012* Check buffer behind A
10013*
10014 IF( ipost .GT. 0 ) THEN
10015 j = ipre + lda*n + 1
10016 DO 20 i = j, j+ipost-1
10017 IF( mem(i) .NE. checkval ) THEN
10018 nerr = nerr + 1
10019 IF( nerr .LE. maxerr ) THEN
10020 erribuf(1, nerr) = testnum
10021 erribuf(2, nerr) = src
10022 erribuf(3, nerr) = dest
10023 erribuf(4, nerr) = i - j + 1
10024 erribuf(5, nerr) = j
10025 erribuf(6, nerr) = err_post
10026 errdbuf(1, nerr) = mem(i)
10027 errdbuf(2, nerr) = checkval
10028 END IF
10029 END IF
10030 20 CONTINUE
10031 END IF
10032*
10033* Check all (LDA-M) gaps
10034*
10035 IF( lda .GT. m ) THEN
10036 DO 40 j = 1, n
10037 DO 30 i = m+1, lda
10038 k = ipre + (j-1)*lda + i
10039 IF( mem(k) .NE. checkval) THEN
10040 nerr = nerr + 1
10041 IF( nerr .LE. maxerr ) THEN
10042 erribuf(1, nerr) = testnum
10043 erribuf(2, nerr) = src
10044 erribuf(3, nerr) = dest
10045 erribuf(4, nerr) = i
10046 erribuf(5, nerr) = j
10047 erribuf(6, nerr) = err_gap
10048 errdbuf(1, nerr) = mem(k)
10049 errdbuf(2, nerr) = checkval
10050 END IF
10051 END IF
10052 30 CONTINUE
10053 40 CONTINUE
10054 END IF
10055*
10056* Determine limits of trapezoidal matrix
10057*
10058 istrap = .false.
10059 IF( uplo .EQ. 'U' ) THEN
10060 istrap = .true.
10061 IF( m .LE. n ) THEN
10062 irst = 2
10063 irnd = m
10064 icst = 1
10065 icnd = m - 1
10066 ELSEIF( m .GT. n ) THEN
10067 irst = ( m-n ) + 2
10068 irnd = m
10069 icst = 1
10070 icnd = n - 1
10071 ENDIF
10072 IF( diag .EQ. 'U' ) THEN
10073 irst = irst - 1
10074 icnd = icnd + 1
10075 ENDIF
10076 ELSE IF( uplo .EQ. 'L' ) THEN
10077 istrap = .true.
10078 IF( m .LE. n ) THEN
10079 irst = 1
10080 irnd = 1
10081 icst = ( n-m ) + 2
10082 icnd = n
10083 ELSEIF( m .GT. n ) THEN
10084 irst = 1
10085 irnd = 1
10086 icst = 2
10087 icnd = n
10088 ENDIF
10089 IF( diag .EQ. 'U' ) THEN
10090 icst = icst - 1
10091 ENDIF
10092 ENDIF
10093*
10094* Check elements and report any errors
10095*
10096 IF( istrap ) THEN
10097 DO 100 j = icst, icnd
10098 DO 105 i = irst, irnd
10099 IF( mem( ipre + (j-1)*lda + i ) .NE. checkval ) THEN
10100 nerr = nerr + 1
10101 IF( nerr .LE. maxerr ) THEN
10102 erribuf(1, nerr) = testnum
10103 erribuf(2, nerr) = src
10104 erribuf(3, nerr) = dest
10105 erribuf(4, nerr) = i
10106 erribuf(5, nerr) = j
10107 erribuf(6, nerr) = err_tri
10108 errdbuf(1, nerr) = mem( ipre + (j-1)*lda + i )
10109 errdbuf(2, nerr) = checkval
10110 END IF
10111 END IF
10112 105 CONTINUE
10113*
10114* Update the limits to allow filling in padding
10115*
10116 IF( uplo .EQ. 'U' ) THEN
10117 irst = irst + 1
10118 ELSE
10119 irnd = irnd + 1
10120 ENDIF
10121 100 CONTINUE
10122 END IF
10123*
10124 RETURN
10125*
10126* End of CCHKPAD.
10127*
integer function ibtnprocs()
Definition btprim.f:81
Here is the caller graph for this function: