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

◆ schkmat()

subroutine schkmat ( character*1  uplo,
character*1  diag,
integer  m,
integer  n,
real, dimension(lda,n)  a,
integer  lda,
integer  rsrc,
integer  csrc,
integer  myrow,
integer  mycol,
integer  testnum,
integer  maxerr,
integer  nerr,
integer, dimension(6, maxerr)  erribuf,
real, dimension(2, maxerr)  errdbuf 
)

Definition at line 8004 of file blacstest.f.

8007*
8008* -- BLACS tester (version 1.0) --
8009* University of Tennessee
8010* December 15, 1994
8011*
8012*
8013* .. Scalar Arguments ..
8014 CHARACTER*1 UPLO, DIAG
8015 INTEGER M, N, LDA, RSRC, CSRC, MYROW, MYCOL, TESTNUM
8016 INTEGER MAXERR, NERR
8017* ..
8018* .. Array Arguments ..
8019 INTEGER ERRIBUF(6, MAXERR)
8020 REAL A(LDA,N), ERRDBUF(2, MAXERR)
8021* ..
8022*
8023* Purpose
8024* =======
8025* sCHKMAT: Check matrix to see whether there were any transmission
8026* errors.
8027*
8028* Arguments
8029* =========
8030* UPLO (input) CHARACTER*1
8031* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
8032* rectangular?
8033*
8034* DIAG (input) CHARACTER*1
8035* For trapezoidal matrices, is the main diagonal included
8036* ('N') or not ('U')?
8037*
8038* M (input) INTEGER
8039* The number of rows of the matrix A. M >= 0.
8040*
8041* N (input) INTEGER
8042* The number of columns of the matrix A. N >= 0.
8043*
8044* A (input) @up@(doctype) array, dimension (LDA,N)
8045* The m by n matrix A. Fortran77 (column-major) storage
8046* assumed.
8047*
8048* LDA (input) INTEGER
8049* The leading dimension of the array A. LDA >= max(1, M).
8050*
8051* RSRC (input) INTEGER
8052* The process row of the source of the matrix.
8053*
8054* CSRC (input) INTEGER
8055* The process column of the source of the matrix.
8056*
8057* MYROW (input) INTEGER
8058* Row of this process in the process grid.
8059*
8060* MYCOL (input) INTEGER
8061* Column of this process in the process grid.
8062*
8063*
8064* TESTNUM (input) INTEGER
8065* The number of the test being checked.
8066*
8067* MAXERR (input) INTEGER
8068* Max number of errors that can be stored in ERRIBUFF or
8069* ERRSBUFF
8070*
8071* NERR (output) INTEGER
8072* The number of errors that have been found.
8073*
8074* ERRIBUF (output) INTEGER array, dimension (6,MAXERRS)
8075* Buffer in which to store integer error information. It will
8076* be built up in the following format for the call to TSEND.
8077* All integer information is recorded in the following 6-tuple
8078* {TESTNUM, SRC, DEST, I, J, WHAT}. These values are figured:
8079* SRC = RSRC * NPROCS + CSRC
8080* DEST = RDEST * NPROCS + CDEST
8081* WHAT
8082* = 1 : Error in pre-padding
8083* = 2 : Error in post-padding
8084* = 3 : Error in LDA-M gap
8085* = 4 : Error in complementory triangle
8086* ELSE: Error in matrix
8087* If there are more errors than can fit in the error buffer,
8088* the error number will indicate the actual number of errors
8089* found, but the buffer will be truncated to the maximum
8090* number of errors which can fit.
8091*
8092* ERRDBUF (output) @(doctype) array, dimension (2, MAXERRS)
8093* Buffer in which to store error data information.
8094* {Incorrect, Predicted}
8095*
8096* ===================================================================
8097*
8098* .. Local Scalars ..
8099 INTEGER I, J, NPROCS, SRC, DEST
8100 LOGICAL USEIT
8101 REAL COMPVAL
8102* ..
8103* .. Local Arrays ..
8104 INTEGER ISEED(4)
8105* ..
8106* .. External Functions ..
8107 INTEGER IBTNPROCS
8108 REAL SBTRAN
8109 EXTERNAL sbtran, ibtnprocs
8110* ..
8111* .. Executable Statements ..
8112*
8113 nprocs = ibtnprocs()
8114 src = rsrc * nprocs + csrc
8115 dest = myrow * nprocs + mycol
8116*
8117* Initialize ISEED with the same values as used in SGENMAT.
8118*
8119 iseed(1) = mod( 1002 + testnum*5 + src*3, 4096 )
8120 iseed(2) = mod( 2027 + testnum*7 + src, 4096 )
8121 iseed(3) = mod( 1234 + testnum + src*3, 4096 )
8122 iseed(4) = mod( 4311 + testnum*10 + src*2, 4096 )
8123*
8124* Generate the elements randomly with the same method used in GENMAT.
8125* Note that for trapezoidal matrices, we generate all elements in the
8126* enclosing rectangle and then ignore the complementary triangle.
8127*
8128 DO 100 j = 1, n
8129 DO 105 i = 1, m
8130 compval = sbtran( iseed )
8131*
8132* Now determine whether we actually need this value. The
8133* strategy is to chop out the proper triangle based on what
8134* particular kind of trapezoidal matrix we're dealing with.
8135*
8136 useit = .true.
8137 IF( uplo .EQ. 'U' ) THEN
8138 IF( m .LE. n ) THEN
8139 IF( diag .EQ. 'U' ) THEN
8140 IF( i .GE. j ) THEN
8141 useit = .false.
8142 END IF
8143 ELSE
8144 IF( i .GT. j ) THEN
8145 useit = .false.
8146 END IF
8147 END IF
8148 ELSE
8149 IF( diag .EQ. 'U' ) THEN
8150 IF( i .GE. m-n+j ) THEN
8151 useit = .false.
8152 END IF
8153 ELSE
8154 IF( i .GT. m-n+j ) THEN
8155 useit = .false.
8156 END IF
8157 END IF
8158 END IF
8159 ELSE IF( uplo .EQ. 'L' ) THEN
8160 IF( m .LE. n ) THEN
8161 IF( diag .EQ. 'U' ) THEN
8162 IF( j. ge. i+(n-m) ) THEN
8163 useit = .false.
8164 END IF
8165 ELSE
8166 IF( j .GT. i+(n-m) ) THEN
8167 useit = .false.
8168 END IF
8169 END IF
8170 ELSE
8171 IF( diag .EQ. 'U' ) THEN
8172 IF( j .GE. i ) THEN
8173 useit = .false.
8174 END IF
8175 ELSE
8176 IF( j .GT. i ) THEN
8177 useit = .false.
8178 END IF
8179 END IF
8180 END IF
8181 END IF
8182*
8183* Compare the generated value to the one that's in the
8184* received matrix. If they don't match, tack another
8185* error record onto what's already there.
8186*
8187 IF( useit ) THEN
8188 IF( a(i,j) .NE. compval ) THEN
8189 nerr = nerr + 1
8190 IF( nerr .LE. maxerr ) THEN
8191 erribuf(1, nerr) = testnum
8192 erribuf(2, nerr) = src
8193 erribuf(3, nerr) = dest
8194 erribuf(4, nerr) = i
8195 erribuf(5, nerr) = j
8196 erribuf(6, nerr) = 5
8197 errdbuf(1, nerr) = a(i, j)
8198 errdbuf(2, nerr) = compval
8199 END IF
8200 END IF
8201 END IF
8202 105 CONTINUE
8203 100 CONTINUE
8204 RETURN
8205*
8206* End of SCHKMAT.
8207*
real function sbtran(iseed)
Definition blacstest.f:7555
integer function ibtnprocs()
Definition btprim.f:81