1 SUBROUTINE psgesv( N, NRHS, A, IA, JA, DESCA, IPIV, B, IB, JB,
10 INTEGER IA, IB, INFO, JA, JB, N, NRHS
13 INTEGER DESCA( * ), DESCB( * ), IPIV( * )
156 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
157 $ lld_, mb_, m_, nb_, n_, rsrc_
158 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
159 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
160 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
163 INTEGER IAROW, IBROW, ICOFFA, ICTXT, IROFFA, IROFFB,
164 $ mycol, myrow, npcol, nprow
167 INTEGER IDUM1( 1 ), IDUM2( 1 )
184 ictxt = desca( ctxt_ )
185 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
190 IF( nprow.EQ.-1 )
THEN
193 CALL chk1mat( n, 1, n, 1, ia, ja, desca, 6, info )
194 CALL chk1mat( n, 1, nrhs, 2, ib, jb, descb, 11, info )
196 iarow = indxg2p( ia, desca( mb_ ), myrow, desca( rsrc_ ),
198 ibrow = indxg2p( ib, descb( mb_ ), myrow, descb( rsrc_ ),
200 iroffa = mod( ia-1, desca( mb_ ) )
201 icoffa = mod( ja-1, desca( nb_ ) )
202 iroffb = mod( ib-1, descb( mb_ ) )
203 IF( iroffa.NE.0 )
THEN
205 ELSE IF( icoffa.NE.0 )
THEN
207 ELSE IF( desca( mb_ ).NE.desca( nb_ ) )
THEN
209 ELSE IF( ibrow.NE.iarow .OR. icoffa.NE.iroffb )
THEN
211 ELSE IF( descb( mb_ ).NE.desca( nb_ ) )
THEN
213 ELSE IF( ictxt.NE.descb( ctxt_ ) )
THEN
217 CALL pchk2mat( n, 1, n, 1, ia, ja, desca, 6, n, 1, nrhs, 2,
218 $ ib, jb, descb, 11, 0, idum1, idum2, info )
222 CALL pxerbla( ictxt,
'PSGESV', -info )
228 CALL psgetrf( n, n, a, ia, ja, desca, ipiv, info )
235 CALL psgetrs(
'No transpose', n, nrhs, a, ia, ja, desca, ipiv,
236 $ b, ib, jb, descb, info )