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

◆ pchk1mat()

subroutine pchk1mat ( integer  ma,
integer  mapos0,
integer  na,
integer  napos0,
integer  ia,
integer  ja,
integer, dimension( * )  desca,
integer  descapos0,
integer  nextra,
integer, dimension( nextra )  ex,
integer, dimension( nextra )  expos,
integer  info 
)

Definition at line 1 of file pchkxmat.f.

3*
4* -- ScaLAPACK tools routine (version 1.7) --
5* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
6* and University of California, Berkeley.
7* May 1, 1997
8*
9* .. Scalar Arguments ..
10 INTEGER DESCAPOS0, IA, INFO, JA, MA, MAPOS0, NA,
11 $ NAPOS0, NEXTRA
12* ..
13* .. Array Arguments ..
14 INTEGER DESCA( * ), EX( NEXTRA ), EXPOS( NEXTRA )
15* ..
16*
17* Purpose
18* =======
19*
20* PCHK1MAT checks that the values associated with one distributed
21* matrix are consistant across the entire process grid.
22*
23* Notes
24* =====
25*
26* This routine checks that all values are the same across the grid.
27* It does no local checking; it is therefore legal to abuse the
28* definitions of the non-descriptor arguments, i.e., if the routine
29* you are checking does not possess a MA value, you may pass some
30* other integer that must be global into this argument instead.
31*
32* Arguments
33* =========
34*
35* MA (global input) INTEGER
36* The global number of matrix rows of A being operated on.
37*
38* MAPOS0 (global input) INTEGER
39* Where in the calling routine's parameter list MA appears.
40*
41* NA (global input) INTEGER
42* The global number of matrix columns of A being operated on.
43*
44* NAPOS0 (global input) INTEGER
45* Where in the calling routine's parameter list NA appears.
46*
47* IA (global input) INTEGER
48* The row index in the global array A indicating the first
49* row of sub( A ).
50*
51* JA (global input) INTEGER
52* The column index in the global array A indicating the
53* first column of sub( A ).
54*
55* DESCA (global and local input) INTEGER array of dimension DLEN_.
56* The array descriptor for the distributed matrix A.
57*
58* DESCAPOS0 (global input) INTEGER
59* Where in the calling routine's parameter list DESCA
60* appears. Note that we assume IA and JA are respectively 2
61* and 1 entries behind DESCA.
62*
63* NEXTRA (global input) INTEGER
64* The number of extra parameters (i.e., besides the ones
65* above) to check. NEXTRA <= LDW - 11.
66*
67* EX (local input) INTEGER array of dimension (NEXTRA)
68* The values of these extra parameters
69*
70* EXPOS (local input) INTEGER array of dimension (NEXTRA)
71* The parameter list positions of these extra values.
72*
73* INFO (local input/global output) INTEGER
74* = 0: successful exit
75* < 0: If the i-th argument is an array and the j-entry had
76* an illegal value, then INFO = -(i*100+j), if the i-th
77* argument is a scalar and had an illegal value, then
78* INFO = -i.
79*
80* =====================================================================
81*
82* .. Parameters ..
83 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
84 $ LLD_, MB_, M_, NB_, N_, RSRC_
85 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
86 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
87 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
88 INTEGER BIGNUM, DESCMULT, LDW
89 parameter( descmult = 100, bignum = descmult * descmult,
90 $ ldw = 25 )
91* ..
92* .. Local Scalars ..
93 INTEGER DESCPOS, K
94* ..
95* .. Local Arrays ..
96 INTEGER IWORK( LDW, 2 ), IWORK2( LDW )
97* ..
98* .. External Subroutines ..
99 EXTERNAL globchk
100* ..
101* .. Executable Statements ..
102*
103* Want to find errors with MIN( ), so if no error, set it to a big
104* number. If there already is an error, multiply by the the
105* descriptor multiplier.
106*
107 IF( info.GE.0 ) THEN
108 info = bignum
109 ELSE IF( info.LT.-descmult ) THEN
110 info = -info
111 ELSE
112 info = -info * descmult
113 END IF
114*
115* Pack values and their positions in the parameter list, factoring
116* in the descriptor multiplier
117*
118 iwork( 1, 1 ) = ma
119 iwork( 1, 2 ) = mapos0 * descmult
120 iwork( 2, 1 ) = na
121 iwork( 2, 2 ) = napos0 * descmult
122 iwork( 3, 1 ) = ia
123 iwork( 3, 2 ) = (descapos0-2) * descmult
124 iwork( 4, 1 ) = ja
125 iwork( 4, 2 ) = (descapos0-1) * descmult
126 descpos = descapos0 * descmult
127*
128 iwork( 5, 1 ) = desca( dtype_ )
129 iwork( 5, 2 ) = descpos + dtype_
130 iwork( 6, 1 ) = desca( m_ )
131 iwork( 6, 2 ) = descpos + m_
132 iwork( 7, 1 ) = desca( n_ )
133 iwork( 7, 2 ) = descpos + n_
134 iwork( 8, 1 ) = desca( mb_ )
135 iwork( 8, 2 ) = descpos + mb_
136 iwork( 9, 1 ) = desca( nb_ )
137 iwork( 9, 2 ) = descpos + nb_
138 iwork( 10, 1 ) = desca( rsrc_ )
139 iwork( 10, 2 ) = descpos + rsrc_
140 iwork( 11, 1 ) = desca( csrc_ )
141 iwork( 11, 2 ) = descpos + csrc_
142*
143 IF( nextra.GT.0 ) THEN
144 DO 10 k = 1, nextra
145 iwork( 11+k, 1 ) = ex( k )
146 iwork( 11+k, 2 ) = expos( k )
147 10 CONTINUE
148 END IF
149 k = 11 + nextra
150*
151* Get the smallest error detected anywhere (BIGNUM if no error)
152*
153 CALL globchk( desca( ctxt_ ), k, iwork, ldw, iwork2, info )
154*
155* Prepare output: set info = 0 if no error, and divide by DESCMULT if
156* error is not in a descriptor entry
157*
158 IF( info .EQ. bignum ) THEN
159 info = 0
160 ELSE IF( mod( info, descmult ) .EQ. 0 ) THEN
161 info = -info / descmult
162 ELSE
163 info = -info
164 END IF
165*
166 RETURN
167*
168* End of PCHK1MAT
169*
subroutine globchk(ictxt, n, x, ldx, iwork, info)
Definition pchkxmat.f:403
Here is the call graph for this function: