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

◆ ichkpad()

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

Definition at line 6679 of file blacstest.f.

6682*
6683* -- BLACS tester (version 1.0) --
6684* University of Tennessee
6685* December 15, 1994
6686*
6687*
6688* .. Scalar Arguments ..
6689 CHARACTER*1 UPLO, DIAG
6690 INTEGER M, N, LDA, RSRC, CSRC, MYROW, MYCOL, IPRE, IPOST
6691 INTEGER TESTNUM, MAXERR, NERR
6692 INTEGER CHECKVAL
6693* ..
6694* .. Array Arguments ..
6695 INTEGER ERRIBUF(6, MAXERR)
6696 INTEGER MEM(*), ERRDBUF(2, MAXERR)
6697* ..
6698*
6699* Purpose
6700* =======
6701* ICHKPAD: Check padding put in by PADMAT.
6702* Checks that padding around target matrix has not been overwritten
6703* by the previous point-to-point or broadcast send.
6704*
6705* Arguments
6706* =========
6707* UPLO (input) CHARACTER*1
6708* Is the matrix A 'U'pper or 'L'ower trapezoidal, or 'G'eneral
6709* rectangular?
6710*
6711* DIAG (input) CHARACTER*1
6712* For trapezoidal matrices, is the main diagonal included
6713* ('N') or not ('U')?
6714*
6715* M (input) INTEGER
6716* The number of rows of the matrix A. M >= 0.
6717*
6718* N (input) INTEGER
6719* The number of columns of the matrix A. N >= 0.
6720*
6721* MEM (input) integer array, dimension(IPRE+IPOST+LDA*N).
6722* Memory location IPRE elements in front of the matrix A.
6723*
6724* LDA (input) INTEGER
6725* The leading dimension of the array A. LDA >= max(1, M).
6726*
6727* RSRC (input) INTEGER
6728* The process row of the source of the matrix.
6729*
6730* CSRC (input) INTEGER
6731* The process column of the source of the matrix.
6732*
6733* MYROW (input) INTEGER
6734* Row of this process in the process grid.
6735*
6736* MYCOL (input) INTEGER
6737* Column of this process in the process grid.
6738*
6739* IPRE (input) INTEGER
6740* The size of the guard zone before the start of A.
6741*
6742* IPOST (input) INTEGER
6743* The size of guard zone after A.
6744*
6745* CHECKVAL (input) integer
6746* The value to pad matrix with.
6747*
6748* TESTNUM (input) INTEGER
6749* The number of the test being checked.
6750*
6751* MAXERR (input) INTEGER
6752* Max number of errors that can be stored in ERRIBUFF or
6753* ERRIBUFF
6754*
6755* NERR (output) INTEGER
6756* The number of errors that have been found.
6757*
6758* ERRIBUF (output) INTEGER array, dimension (6,MAXERRS)
6759* Buffer in which to store integer error information. It will
6760* be built up in the following format for the call to TSEND.
6761* All integer information is recorded in the following 6-tuple
6762* {TESTNUM, SRC, DEST, I, J, WHAT}. These values are figured:
6763* SRC = RSRC * NPROCS + CSRC
6764* DEST = RDEST * NPROCS + CDEST
6765* WHAT
6766* = 1 : Error in pre-padding
6767* = 2 : Error in post-padding
6768* = 3 : Error in LDA-M gap
6769* = 4 : Error in complementory triangle
6770* ELSE: Error in matrix
6771* If there are more errors than can fit in the error buffer,
6772* the error number will indicate the actual number of errors
6773* found, but the buffer will be truncated to the maximum
6774* number of errors which can fit.
6775*
6776* ERRDBUF (output) @(doctype) array, dimension (2, MAXERRS)
6777* Buffer in which to store error data information.
6778* {Incorrect, Predicted}
6779*
6780* ===================================================================
6781*
6782* .. Parameters ..
6783 INTEGER ERR_PRE, ERR_POST, ERR_GAP, ERR_TRI, ERR_MAT
6784 parameter( err_pre = 1, err_post = 2, err_gap = 3, err_tri = 4 )
6785 parameter( err_mat = 5 )
6786* ..
6787* .. External Functions ..
6788 INTEGER IBTNPROCS
6789 EXTERNAL ibtnprocs
6790* ..
6791* .. Local Scalars ..
6792 LOGICAL ISTRAP
6793 INTEGER I, J, K, IRST, IRND, ICST, ICND, SRC, DEST
6794 INTEGER NPROCS
6795* ..
6796* .. Executable Statements ..
6797*
6798 nprocs = ibtnprocs()
6799 src = rsrc * nprocs + csrc
6800 dest = myrow * nprocs + mycol
6801*
6802* Check buffer in front of A
6803*
6804 IF( ipre .GT. 0 ) THEN
6805 DO 10 i = 1, ipre
6806 IF( mem(i) .NE. checkval ) THEN
6807 nerr = nerr + 1
6808 IF( nerr .LE. maxerr ) THEN
6809 erribuf(1, nerr) = testnum
6810 erribuf(2, nerr) = src
6811 erribuf(3, nerr) = dest
6812 erribuf(4, nerr) = i
6813 erribuf(5, nerr) = ipre - i + 1
6814 erribuf(6, nerr) = err_pre
6815 errdbuf(1, nerr) = mem(i)
6816 errdbuf(2, nerr) = checkval
6817 END IF
6818 END IF
6819 10 CONTINUE
6820 END IF
6821*
6822* Check buffer behind A
6823*
6824 IF( ipost .GT. 0 ) THEN
6825 j = ipre + lda*n + 1
6826 DO 20 i = j, j+ipost-1
6827 IF( mem(i) .NE. checkval ) THEN
6828 nerr = nerr + 1
6829 IF( nerr .LE. maxerr ) THEN
6830 erribuf(1, nerr) = testnum
6831 erribuf(2, nerr) = src
6832 erribuf(3, nerr) = dest
6833 erribuf(4, nerr) = i - j + 1
6834 erribuf(5, nerr) = j
6835 erribuf(6, nerr) = err_post
6836 errdbuf(1, nerr) = mem(i)
6837 errdbuf(2, nerr) = checkval
6838 END IF
6839 END IF
6840 20 CONTINUE
6841 END IF
6842*
6843* Check all (LDA-M) gaps
6844*
6845 IF( lda .GT. m ) THEN
6846 DO 40 j = 1, n
6847 DO 30 i = m+1, lda
6848 k = ipre + (j-1)*lda + i
6849 IF( mem(k) .NE. checkval) THEN
6850 nerr = nerr + 1
6851 IF( nerr .LE. maxerr ) THEN
6852 erribuf(1, nerr) = testnum
6853 erribuf(2, nerr) = src
6854 erribuf(3, nerr) = dest
6855 erribuf(4, nerr) = i
6856 erribuf(5, nerr) = j
6857 erribuf(6, nerr) = err_gap
6858 errdbuf(1, nerr) = mem(k)
6859 errdbuf(2, nerr) = checkval
6860 END IF
6861 END IF
6862 30 CONTINUE
6863 40 CONTINUE
6864 END IF
6865*
6866* Determine limits of trapezoidal matrix
6867*
6868 istrap = .false.
6869 IF( uplo .EQ. 'U' ) THEN
6870 istrap = .true.
6871 IF( m .LE. n ) THEN
6872 irst = 2
6873 irnd = m
6874 icst = 1
6875 icnd = m - 1
6876 ELSEIF( m .GT. n ) THEN
6877 irst = ( m-n ) + 2
6878 irnd = m
6879 icst = 1
6880 icnd = n - 1
6881 ENDIF
6882 IF( diag .EQ. 'U' ) THEN
6883 irst = irst - 1
6884 icnd = icnd + 1
6885 ENDIF
6886 ELSE IF( uplo .EQ. 'L' ) THEN
6887 istrap = .true.
6888 IF( m .LE. n ) THEN
6889 irst = 1
6890 irnd = 1
6891 icst = ( n-m ) + 2
6892 icnd = n
6893 ELSEIF( m .GT. n ) THEN
6894 irst = 1
6895 irnd = 1
6896 icst = 2
6897 icnd = n
6898 ENDIF
6899 IF( diag .EQ. 'U' ) THEN
6900 icst = icst - 1
6901 ENDIF
6902 ENDIF
6903*
6904* Check elements and report any errors
6905*
6906 IF( istrap ) THEN
6907 DO 100 j = icst, icnd
6908 DO 105 i = irst, irnd
6909 IF( mem( ipre + (j-1)*lda + i ) .NE. checkval ) THEN
6910 nerr = nerr + 1
6911 IF( nerr .LE. maxerr ) THEN
6912 erribuf(1, nerr) = testnum
6913 erribuf(2, nerr) = src
6914 erribuf(3, nerr) = dest
6915 erribuf(4, nerr) = i
6916 erribuf(5, nerr) = j
6917 erribuf(6, nerr) = err_tri
6918 errdbuf(1, nerr) = mem( ipre + (j-1)*lda + i )
6919 errdbuf(2, nerr) = checkval
6920 END IF
6921 END IF
6922 105 CONTINUE
6923*
6924* Update the limits to allow filling in padding
6925*
6926 IF( uplo .EQ. 'U' ) THEN
6927 irst = irst + 1
6928 ELSE
6929 irnd = irnd + 1
6930 ENDIF
6931 100 CONTINUE
6932 END IF
6933*
6934 RETURN
6935*
6936* End of ICHKPAD.
6937*
integer function ibtnprocs()
Definition btprim.f:81
Here is the caller graph for this function: