50 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
51 $ MB_, NB_, RSRC_, CSRC_, LLD_
52 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
53 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
54 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
58 INTEGER CONTEXTC, CSRC_A, IACOL, IAROW, ICOFFA, IROFFA,
68 INTEGER ILCM, INDXG2P, NUMROC, SL_GRIDRESHAPE
69 EXTERNAL ilcm, indxg2p, lsame, numroc, sl_gridreshape
72 EXTERNAL blacs_gridinfo, blacs_gridexit
79 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
82 CALL blacs_gridinfo( desca( ctxt_ ), nprow, npcol, myrow, mycol )
85 rsrc_a = desca( rsrc_ )
86 csrc_a = desca( csrc_ )
87 lcm = ilcm( nprow, npcol )
91 iarow = indxg2p( 1, nb, myrow, rsrc_a, nprow )
92 iacol = indxg2p( 1, nb, mycol, csrc_a, npcol )
93 np = numroc( n+iroffa, nb, myrow, iarow, nprow )
94 nq = numroc( n+icoffa, nb, mycol, iacol, npcol )
95 sizemqrleft =
max( ( nb*( nb-1 ) ) / 2, ( np+nq )*nb ) + nb*nb
96 sizemqrright =
max( ( nb*( nb-1 ) ) / 2,
97 $ ( nq+
max( np+numroc( numroc( n+icoffa, nb, 0, 0,
98 $ npcol ), nb, 0, 0, lcmq ), np ) )*nb ) + nb*nb
100 np0 = numroc( nn, nb, 0, 0, nprow )
101 mq0 = numroc( nn, nb, 0, 0, npcol )
103 wantz = lsame( jobz,
'V' )
109 contextc = sl_gridreshape( desca( ctxt_ ), 0, 1, 1, nprocs, 1 )
110 CALL blacs_gridinfo( contextc, nprowc, npcolc, myprowc,
112 nrc = numroc( n, nb, myprowc, 0, nprocs)
114 CALL blacs_gridexit( contextc )
121 qrmem = 5*n +
max( 2*np0 +mq0 + nb*nn, 2*nn-2 ) + n*ldc
122 minsize =
max( sizemqrleft, sizemqrright, qrmem )
124 minsize = 5*n + 2*np0 +mq0 + nb*nn