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

◆ zchkpad()

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

Definition at line 10937 of file blacstest.f.

10940*
10941* -- BLACS tester (version 1.0) --
10942* University of Tennessee
10943* December 15, 1994
10944*
10945*
10946* .. Scalar Arguments ..
10947 CHARACTER*1 UPLO, DIAG
10948 INTEGER M, N, LDA, RSRC, CSRC, MYROW, MYCOL, IPRE, IPOST
10949 INTEGER TESTNUM, MAXERR, NERR
10950 DOUBLE COMPLEX CHECKVAL
10951* ..
10952* .. Array Arguments ..
10953 INTEGER ERRIBUF(6, MAXERR)
10954 DOUBLE COMPLEX MEM(*), ERRDBUF(2, MAXERR)
10955* ..
10956*
10957* Purpose
10958* =======
10959* ZCHKPAD: Check padding put in by PADMAT.
10960* Checks that padding around target matrix has not been overwritten
10961* by the previous point-to-point or broadcast send.
10962*
10963* Arguments
10964* =========
10965* UPLO (input) CHARACTER*1
10966* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
10967* rectangular?
10968*
10969* DIAG (input) CHARACTER*1
10970* For trapezoidal matrices, is the main diagonal included
10971* ('N') or not ('U')?
10972*
10973* M (input) INTEGER
10974* The number of rows of the matrix A. M >= 0.
10975*
10976* N (input) INTEGER
10977* The number of columns of the matrix A. N >= 0.
10978*
10979* MEM (input) double complex array, dimension(IPRE+IPOST+LDA*N).
10980* Memory location IPRE elements in front of the matrix A.
10981*
10982* LDA (input) INTEGER
10983* The leading dimension of the array A. LDA >= max(1, M).
10984*
10985* RSRC (input) INTEGER
10986* The process row of the source of the matrix.
10987*
10988* CSRC (input) INTEGER
10989* The process column of the source of the matrix.
10990*
10991* MYROW (input) INTEGER
10992* Row of this process in the process grid.
10993*
10994* MYCOL (input) INTEGER
10995* Column of this process in the process grid.
10996*
10997* IPRE (input) INTEGER
10998* The size of the guard zone before the start of A.
10999*
11000* IPOST (input) INTEGER
11001* The size of guard zone after A.
11002*
11003* CHECKVAL (input) double complex
11004* The value to pad matrix with.
11005*
11006* TESTNUM (input) INTEGER
11007* The number of the test being checked.
11008*
11009* MAXERR (input) INTEGER
11010* Max number of errors that can be stored in ERRIBUFF or
11011* ERRZBUFF
11012*
11013* NERR (output) INTEGER
11014* The number of errors that have been found.
11015*
11016* ERRIBUF (output) INTEGER array, dimension (6,MAXERRS)
11017* Buffer in which to store integer error information. It will
11018* be built up in the following format for the call to TSEND.
11019* All integer information is recorded in the following 6-tuple
11020* {TESTNUM, SRC, DEST, I, J, WHAT}. These values are figured:
11021* SRC = RSRC * NPROCS + CSRC
11022* DEST = RDEST * NPROCS + CDEST
11023* WHAT
11024* = 1 : Error in pre-padding
11025* = 2 : Error in post-padding
11026* = 3 : Error in LDA-M gap
11027* = 4 : Error in complementory triangle
11028* ELSE: Error in matrix
11029* If there are more errors than can fit in the error buffer,
11030* the error number will indicate the actual number of errors
11031* found, but the buffer will be truncated to the maximum
11032* number of errors which can fit.
11033*
11034* ERRDBUF (output) @(doctype) array, dimension (2, MAXERRS)
11035* Buffer in which to store error data information.
11036* {Incorrect, Predicted}
11037*
11038* ===================================================================
11039*
11040* .. Parameters ..
11041 INTEGER ERR_PRE, ERR_POST, ERR_GAP, ERR_TRI, ERR_MAT
11042 parameter( err_pre = 1, err_post = 2, err_gap = 3, err_tri = 4 )
11043 parameter( err_mat = 5 )
11044* ..
11045* .. External Functions ..
11046 INTEGER IBTNPROCS
11047 EXTERNAL ibtnprocs
11048* ..
11049* .. Local Scalars ..
11050 LOGICAL ISTRAP
11051 INTEGER I, J, K, IRST, IRND, ICST, ICND, SRC, DEST
11052 INTEGER NPROCS
11053* ..
11054* .. Executable Statements ..
11055*
11056 nprocs = ibtnprocs()
11057 src = rsrc * nprocs + csrc
11058 dest = myrow * nprocs + mycol
11059*
11060* Check buffer in front of A
11061*
11062 IF( ipre .GT. 0 ) THEN
11063 DO 10 i = 1, ipre
11064 IF( mem(i) .NE. checkval ) THEN
11065 nerr = nerr + 1
11066 IF( nerr .LE. maxerr ) THEN
11067 erribuf(1, nerr) = testnum
11068 erribuf(2, nerr) = src
11069 erribuf(3, nerr) = dest
11070 erribuf(4, nerr) = i
11071 erribuf(5, nerr) = ipre - i + 1
11072 erribuf(6, nerr) = err_pre
11073 errdbuf(1, nerr) = mem(i)
11074 errdbuf(2, nerr) = checkval
11075 END IF
11076 END IF
11077 10 CONTINUE
11078 END IF
11079*
11080* Check buffer behind A
11081*
11082 IF( ipost .GT. 0 ) THEN
11083 j = ipre + lda*n + 1
11084 DO 20 i = j, j+ipost-1
11085 IF( mem(i) .NE. checkval ) THEN
11086 nerr = nerr + 1
11087 IF( nerr .LE. maxerr ) THEN
11088 erribuf(1, nerr) = testnum
11089 erribuf(2, nerr) = src
11090 erribuf(3, nerr) = dest
11091 erribuf(4, nerr) = i - j + 1
11092 erribuf(5, nerr) = j
11093 erribuf(6, nerr) = err_post
11094 errdbuf(1, nerr) = mem(i)
11095 errdbuf(2, nerr) = checkval
11096 END IF
11097 END IF
11098 20 CONTINUE
11099 END IF
11100*
11101* Check all (LDA-M) gaps
11102*
11103 IF( lda .GT. m ) THEN
11104 DO 40 j = 1, n
11105 DO 30 i = m+1, lda
11106 k = ipre + (j-1)*lda + i
11107 IF( mem(k) .NE. checkval) THEN
11108 nerr = nerr + 1
11109 IF( nerr .LE. maxerr ) THEN
11110 erribuf(1, nerr) = testnum
11111 erribuf(2, nerr) = src
11112 erribuf(3, nerr) = dest
11113 erribuf(4, nerr) = i
11114 erribuf(5, nerr) = j
11115 erribuf(6, nerr) = err_gap
11116 errdbuf(1, nerr) = mem(k)
11117 errdbuf(2, nerr) = checkval
11118 END IF
11119 END IF
11120 30 CONTINUE
11121 40 CONTINUE
11122 END IF
11123*
11124* Determine limits of trapezoidal matrix
11125*
11126 istrap = .false.
11127 IF( uplo .EQ. 'U' ) THEN
11128 istrap = .true.
11129 IF( m .LE. n ) THEN
11130 irst = 2
11131 irnd = m
11132 icst = 1
11133 icnd = m - 1
11134 ELSEIF( m .GT. n ) THEN
11135 irst = ( m-n ) + 2
11136 irnd = m
11137 icst = 1
11138 icnd = n - 1
11139 ENDIF
11140 IF( diag .EQ. 'U' ) THEN
11141 irst = irst - 1
11142 icnd = icnd + 1
11143 ENDIF
11144 ELSE IF( uplo .EQ. 'L' ) THEN
11145 istrap = .true.
11146 IF( m .LE. n ) THEN
11147 irst = 1
11148 irnd = 1
11149 icst = ( n-m ) + 2
11150 icnd = n
11151 ELSEIF( m .GT. n ) THEN
11152 irst = 1
11153 irnd = 1
11154 icst = 2
11155 icnd = n
11156 ENDIF
11157 IF( diag .EQ. 'U' ) THEN
11158 icst = icst - 1
11159 ENDIF
11160 ENDIF
11161*
11162* Check elements and report any errors
11163*
11164 IF( istrap ) THEN
11165 DO 100 j = icst, icnd
11166 DO 105 i = irst, irnd
11167 IF( mem( ipre + (j-1)*lda + i ) .NE. checkval ) THEN
11168 nerr = nerr + 1
11169 IF( nerr .LE. maxerr ) THEN
11170 erribuf(1, nerr) = testnum
11171 erribuf(2, nerr) = src
11172 erribuf(3, nerr) = dest
11173 erribuf(4, nerr) = i
11174 erribuf(5, nerr) = j
11175 erribuf(6, nerr) = err_tri
11176 errdbuf(1, nerr) = mem( ipre + (j-1)*lda + i )
11177 errdbuf(2, nerr) = checkval
11178 END IF
11179 END IF
11180 105 CONTINUE
11181*
11182* Update the limits to allow filling in padding
11183*
11184 IF( uplo .EQ. 'U' ) THEN
11185 irst = irst + 1
11186 ELSE
11187 irnd = irnd + 1
11188 ENDIF
11189 100 CONTINUE
11190 END IF
11191*
11192 RETURN
11193*
11194* End of ZCHKPAD.
11195*
integer function ibtnprocs()
Definition btprim.f:81
Here is the caller graph for this function: