1 SUBROUTINE pchk1mat( MA, MAPOS0, NA, NAPOS0, IA, JA, DESCA,
2 $ DESCAPOS0, NEXTRA, EX, EXPOS, INFO )
10 INTEGER DESCAPOS0, IA, INFO, JA, MA, MAPOS0, NA,
14 INTEGER DESCA( * ), EX( NEXTRA ), EXPOS( NEXTRA )
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,
96 INTEGER IWORK( LDW, 2 ), IWORK2( LDW )
109 ELSE IF( info.LT.-descmult )
THEN
112 info = -info * descmult
119 iwork( 1, 2 ) = mapos0 * descmult
121 iwork( 2, 2 ) = napos0 * descmult
123 iwork( 3, 2 ) = (descapos0-2) * descmult
125 iwork( 4, 2 ) = (descapos0-1) * descmult
126 descpos = descapos0 * descmult
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_
143 IF( nextra.GT.0 )
THEN
145 iwork( 11+k, 1 ) = ex( k )
146 iwork( 11+k, 2 ) = expos( k )
153 CALL globchk( desca( ctxt_ ), k, iwork, ldw, iwork2, info )
158 IF( info .EQ. bignum )
THEN
160 ELSE IF( mod( info, descmult ) .EQ. 0 )
THEN
161 info = -info / descmult
172 SUBROUTINE pchk2mat( MA, MAPOS0, NA, NAPOS0, IA, JA, DESCA,
173 $ DESCAPOS0, MB, MBPOS0, NB, NBPOS0, IB, JB,
174 $ DESCB, DESCBPOS0, NEXTRA, EX, EXPOS, INFO )
182 INTEGER DESCAPOS0, DESCBPOS0, IA, IB, INFO, JA, JB, MA,
183 $ MAPOS0, MB, MBPOS0, NA, NAPOS0, NB, NBPOS0,
187 INTEGER DESCA( * ), DESCB( 8 ), EX( NEXTRA ),
285 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
286 $ LLD_, MB_, M_, NB_, N_, RSRC_
287 PARAMETER ( BLOCK_CYCLIC_2D = 1, dlen_ = 9, dtype_ = 1,
288 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
289 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
290 INTEGER DESCMULT, BIGNUM, LDW
291 PARAMETER ( DESCMULT = 100, bignum = descmult * descmult,
298 INTEGER IWORK( LDW, 2 ), IWORK2( LDW )
314 ELSE IF( info.LT.-descmult )
THEN
317 info = -info * descmult
324 iwork( 1, 2 ) = mapos0 * descmult
326 iwork( 2, 2 ) = napos0 * descmult
328 iwork( 3, 2 ) = (descapos0-2) * descmult
330 iwork( 4, 2 ) = (descapos0-1) * descmult
331 descpos = descapos0 * descmult
333 iwork( 5, 1 ) = desca( dtype_ )
334 iwork( 5, 2 ) = descpos + dtype_
335 iwork( 6, 1 ) = desca( m_ )
336 iwork( 6, 2 ) = descpos + m_
337 iwork( 7, 1 ) = desca( n_ )
338 iwork( 7, 2 ) = descpos + n_
339 iwork( 8, 1 ) = desca( mb_ )
340 iwork( 8, 2 ) = descpos + mb_
341 iwork( 9, 1 ) = desca( nb_ )
342 iwork( 9, 2 ) = descpos + nb_
343 iwork( 10, 1 ) = desca( rsrc_ )
344 iwork( 10, 2 ) = descpos + rsrc_
345 iwork( 11, 1 ) = desca( csrc_ )
346 iwork( 11, 2 ) = descpos + csrc_
349 iwork( 12, 2 ) = mbpos0 * descmult
351 iwork( 13, 2 ) = nbpos0 * descmult
353 iwork( 14, 2 ) = (descbpos0-2) * descmult
355 iwork( 15, 2 ) = (descbpos0-1) * descmult
356 descpos = descbpos0 * descmult
358 iwork( 16, 1 ) = descb( dtype_ )
359 iwork( 16, 2 ) = descpos + dtype_
360 iwork( 17, 1 ) = descb( m_ )
361 iwork( 17, 2 ) = descpos + m_
362 iwork( 18, 1 ) = descb( n_ )
363 iwork( 18, 2 ) = descpos + n_
364 iwork( 19, 1 ) = descb( mb_ )
365 iwork( 19, 2 ) = descpos + mb_
366 iwork( 20, 1 ) = descb( nb_ )
367 iwork( 20, 2 ) = descpos + nb_
368 iwork( 21, 1 ) = descb( rsrc_ )
369 iwork( 21, 2 ) = descpos + rsrc_
370 iwork( 22, 1 ) = descb( csrc_ )
371 iwork( 22, 2 ) = descpos + csrc_
373 IF( nextra.GT.0 )
THEN
375 iwork( 22+k, 1 ) = ex( k )
376 iwork( 22+k, 2 ) = expos( k )
383 CALL globchk( desca( ctxt_ ), k, iwork, ldw, iwork2, info )
388 IF( info.EQ.bignum )
THEN
390 ELSE IF( mod( info, descmult ) .EQ. 0 )
THEN
391 info = -info / descmult
402 SUBROUTINE globchk( ICTXT, N, X, LDX, IWORK, INFO )
410 INTEGER ICTXT, INFO, LDX, N
413 INTEGER IWORK( N ), X( LDX, 2 )
454 INTEGER K, MYROW, MYCOL
457 EXTERNAL blacs_gridinfo, igamn2d, igebr2d, igebs2d
464 CALL blacs_gridinfo( ictxt, iwork, k, myrow, mycol )
466 IF( myrow.EQ.0 .AND. mycol.EQ.0 )
THEN
467 CALL igebs2d( ictxt,
'All',
' ', n, 1, x, n )
469 CALL igebr2d( ictxt,
'All',
' ', n, 1, iwork, n, 0, 0 )
471 IF( x( k, 1 ).NE.iwork( k ) )
472 $ info =
min( info, x( k, 2 ) )
476 CALL igamn2d( ictxt,
'All',
' ', 1, 1, info, 1, k, k, -1, -1, 0 )