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

◆ rdcomb()

subroutine rdcomb ( integer  memused,
integer, dimension(memlen)  mem,
integer  memlen,
integer  cmemused,
character*1, dimension(cmemlen)  cmem,
integer  cmemlen,
integer  outnum 
)

Definition at line 5996 of file blacstest.f.

5998*
5999* -- BLACS tester (version 1.0) --
6000* University of Tennessee
6001* December 15, 1994
6002*
6003*
6004* .. Scalar Arguments ..
6005 INTEGER MEMUSED, MEMLEN, CMEMUSED, CMEMLEN, OUTNUM
6006* ..
6007* .. Array Arguments ..
6008 CHARACTER*1 CMEM(CMEMLEN)
6009 INTEGER MEM(MEMLEN)
6010* ..
6011*
6012* Purpose
6013* =======
6014* RDCOMB: Read and process the input file COMB.dat.
6015*
6016* Arguments
6017* =========
6018* MEMUSED (output) INTEGER
6019* Number of elements in MEM that this subroutine ends up using.
6020*
6021* MEM (output) INTEGER array of dimension memlen
6022* On output, holds information read in from sdrv.dat.
6023*
6024* MEMLEN (input) INTEGER
6025* Number of elements of MEM that this subroutine
6026* may safely write into.
6027*
6028* CMEMUSED (output) INTEGER
6029* Number of elements in CMEM that this subroutine ends up using.
6030*
6031* CMEM (output) CHARACTER*1 array of dimension cmemlen
6032* On output, holds the values for UPLO and DIAG.
6033*
6034* CMEMLEN (input) INTEGER
6035* Number of elements of CMEM that this subroutine
6036* may safely write into.
6037*
6038* OUTNUM (input) INTEGER
6039* Unit number of the output file.
6040*
6041* =================================================================
6042*
6043* .. Parameters ..
6044 INTEGER SDIN
6045 parameter( sdin = 12 )
6046* ..
6047* .. External Functions ..
6048 LOGICAL LSAME
6049 EXTERNAL lsame
6050* ..
6051* .. Local Scalars ..
6052 INTEGER TOPSREPEAT, TOPSCOHRNT, NOPS, NSCOPE, NTOP, NMAT, NDEST
6053 INTEGER NGRID, I, J, OPPTR, SCOPEPTR, TOPPTR, MPTR, NPTR
6054 INTEGER LDSPTR, LDDPTR, LDIPTR, RDESTPTR, CDESTPTR, PPTR, QPTR
6055* ..
6056* .. Executable Statements
6057*
6058* Open and read the file comb.dat. The expected format is
6059* below.
6060*
6061*------
6062*integer Number of operations
6063*array of CHAR*1's OPs: '+', '>', '<'
6064*integer Number of scopes
6065*array of CHAR*1's Values for Scopes
6066*HAR*1 Repeatability flag ('R', 'N', 'B')
6067*HAR*1 Coherency flag ('C', 'N', 'B')
6068*integer Number of topologies
6069*array of CHAR*1's Values for TOP
6070*integer number of nmat
6071*array of integers M: number of rows in matrix
6072*array of integers N: number of columns in matrix
6073*integer LDA: leading dimension on source proc
6074*integer LDA: leading dimension on dest proc
6075*integer number of source/dest pairs
6076*array of integers RDEST: process row of msg. dest.
6077*array of integers CDEST: process column of msg. dest.
6078*integer Number of grids
6079*array of integers NPROW: number of rows in process grid
6080*array of integers NPCOL: number of col's in proc. grid
6081*------
6082* note: the text descriptions as shown above are present in
6083* the sample comb.dat included with this distribution,
6084* but are not required.
6085*
6086* Read input file
6087*
6088 memused = 1
6089 cmemused = 1
6090 OPEN(unit = sdin, file = 'comb.dat', status = 'OLD')
6091*
6092* Get what operations to test (+, >, <)
6093*
6094 READ(sdin, *) nops
6095 opptr = cmemused
6096 cmemused = opptr + nops
6097 IF ( cmemused .GT. cmemlen ) THEN
6098 WRITE(outnum, 1000) cmemlen, nops, 'OPERATIONS.'
6099 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6100 stop
6101 ELSE IF( nops .LT. 1 ) THEN
6102 WRITE(outnum, 2000) 'OPERATIONS.'
6103 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6104 stop
6105 END IF
6106*
6107 READ(sdin, *) ( cmem(opptr+i), i = 0, nops-1 )
6108 DO 10 i = 0, nops-1
6109 IF( (cmem(opptr+i).NE.'+') .AND. (cmem(opptr+i).NE.'>') .AND.
6110 $ (cmem(opptr+i).NE.'<') ) THEN
6111 WRITE(outnum,5000) cmem(opptr+i)
6112 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6113 stop
6114 END IF
6115 10 CONTINUE
6116*
6117* Read in scopes and topologies
6118*
6119 READ(sdin, *) nscope
6120 scopeptr = cmemused
6121 cmemused = scopeptr + nscope
6122 IF ( cmemused .GT. cmemlen ) THEN
6123 WRITE(outnum, 1000) cmemlen, nscope, 'SCOPES.'
6124 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6125 stop
6126 ELSE IF( nscope .LT. 1 ) THEN
6127 WRITE(outnum, 2000) 'SCOPE.'
6128 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6129 stop
6130 END IF
6131*
6132 READ(sdin, *) ( cmem(scopeptr+i), i = 0, nscope-1 )
6133 DO 20 i = 0, nscope-1
6134 IF( lsame(cmem(scopeptr+i), 'R') ) THEN
6135 cmem(scopeptr+i) = 'R'
6136 ELSE IF( lsame(cmem(scopeptr+i), 'C') ) THEN
6137 cmem(scopeptr+i) = 'C'
6138 ELSE IF( lsame(cmem(scopeptr+i), 'A') ) THEN
6139 cmem(scopeptr+i) = 'A'
6140 ELSE
6141 WRITE(outnum, 3000) 'SCOPE', cmem(scopeptr+i)
6142 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6143 stop
6144 END IF
6145 20 CONTINUE
6146*
6147 READ(sdin, *) topsrepeat
6148 READ(sdin, *) topscohrnt
6149*
6150 READ(sdin, *) ntop
6151 topptr = cmemused
6152 cmemused = topptr + ntop
6153 IF ( cmemused .GT. cmemlen ) THEN
6154 WRITE(outnum, 1000) cmemlen, ntop, 'TOPOLOGIES.'
6155 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6156 stop
6157 ELSE IF( ntop .LT. 1 ) THEN
6158 WRITE(outnum, 2000) 'TOPOLOGY.'
6159 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6160 stop
6161 END IF
6162 READ(sdin, *) ( cmem(topptr+i), i = 0, ntop-1 )
6163*
6164*
6165* Read in number of matrices, and values for M, N, LDASRC, and LDADEST
6166*
6167 READ(sdin, *) nmat
6168 mptr = memused
6169 nptr = mptr + nmat
6170 ldsptr = nptr + nmat
6171 lddptr = ldsptr + nmat
6172 ldiptr = lddptr + nmat
6173 memused = ldiptr + nmat
6174 IF( memused .GT. memlen ) THEN
6175 WRITE(outnum, 1000) memlen, nmat, 'MATRICES.'
6176 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6177 stop
6178 ELSE IF( nmat .LT. 1 ) THEN
6179 WRITE(outnum, 2000) 'MATRIX.'
6180 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6181 stop
6182 END IF
6183 READ(sdin, *) ( mem( mptr+i ), i = 0, nmat-1 )
6184 READ(sdin, *) ( mem( nptr+i ), i = 0, nmat-1 )
6185 READ(sdin, *) ( mem( ldsptr+i ), i = 0, nmat-1 )
6186 READ(sdin, *) ( mem( lddptr+i ), i = 0, nmat-1 )
6187 READ(sdin, *) ( mem( ldiptr+i ), i = 0, nmat-1 )
6188*
6189* Make sure matrix values are legal
6190*
6191 CALL chkmatdat( outnum, 'COMB.dat', .true., nmat, mem(mptr),
6192 $ mem(nptr), mem(ldsptr), mem(lddptr), mem(ldiptr) )
6193*
6194* Read in number of dest pairs, and values of dest
6195*
6196 READ(sdin, *) ndest
6197 rdestptr = memused
6198 cdestptr = rdestptr + ndest
6199 memused = cdestptr + ndest
6200 IF( memused .GT. memlen ) THEN
6201 WRITE(outnum, 1000) memlen, nmat, 'DEST.'
6202 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6203 stop
6204 ELSE IF( ndest .LT. 1 ) THEN
6205 WRITE(outnum, 2000) 'DEST.'
6206 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6207 stop
6208 END IF
6209 READ(sdin, *) ( mem(rdestptr+i), i = 0, ndest-1 )
6210 READ(sdin, *) ( mem(cdestptr+i), i = 0, ndest-1 )
6211*
6212* Read in number of grids pairs, and values of P (process rows) and
6213* Q (process columns)
6214*
6215 READ(sdin, *) ngrid
6216 pptr = memused
6217 qptr = pptr + ngrid
6218 memused = qptr + ngrid
6219 IF( memused .GT. memlen ) THEN
6220 WRITE(outnum, 1000) memlen, ngrid, 'PROCESS GRIDS.'
6221 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6222 stop
6223 ELSE IF( ngrid .LT. 1 ) THEN
6224 WRITE(outnum, 2000) 'PROCESS GRID'
6225 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE( outnum )
6226 stop
6227 END IF
6228*
6229 READ(sdin, *) ( mem(pptr+i), i = 0, ngrid-1 )
6230 READ(sdin, *) ( mem(qptr+i), i = 0, ngrid-1 )
6231 IF( sdin .NE. 6 .AND. sdin .NE. 0 ) CLOSE( sdin )
6232*
6233* Fatal error if we've got an illegal grid
6234*
6235 DO 70 j = 0, ngrid-1
6236 IF( mem(pptr+j).LT.1 .OR. mem(qptr+j).LT.1 ) THEN
6237 WRITE(outnum, 4000) mem(pptr+j), mem(qptr+j)
6238 IF( outnum .NE. 6 .AND. outnum .NE. 0 ) CLOSE(outnum)
6239 stop
6240 END IF
6241 70 CONTINUE
6242*
6243* Prepare output variables
6244*
6245 mem(memused) = nops
6246 mem(memused+1) = nscope
6247 mem(memused+2) = topsrepeat
6248 mem(memused+3) = topscohrnt
6249 mem(memused+4) = ntop
6250 mem(memused+5) = nmat
6251 mem(memused+6) = ndest
6252 mem(memused+7) = ngrid
6253 memused = memused + 7
6254 cmemused = cmemused - 1
6255*
6256 1000 FORMAT('Mem too short (',i4,') to handle',i4,' ',a20)
6257 2000 FORMAT('Must have at least one ',a20)
6258 3000 FORMAT('UNRECOGNIZABLE ',a5,' ''', a1, '''.')
6259 4000 FORMAT('Illegal process grid: {',i3,',',i3,'}.')
6260 5000 FORMAT('Illegal OP value ''',a1,''':, expected ''+'' (SUM),',
6261 $ ' ''>'' (MAX), or ''<'' (MIN).')
6262*
6263 RETURN
6264*
6265* End of RDCOMB.
6266*
subroutine chkmatdat(nout, infile, tstflag, nmat, m0, n0, ldas0, ldad0, ldi0)
Definition blacstest.f:1791
logical function lsame(ca, cb)
Definition tools.f:1724
Here is the call graph for this function:
Here is the caller graph for this function: