1 SUBROUTINE pzlasizegsep( DESCA, IPREPAD, IPOSTPAD, SIZEMQRLEFT,
2 $ SIZEMQRRIGHT, SIZEQRF, SIZETMS, RSIZEQTQ,
3 $ RSIZECHK, SIZEHEEVX, RSIZEHEEVX,
4 $ ISIZEHEEVX, SIZESUBTST, RSIZESUBTST,
5 $ ISIZESUBTST, SIZETST, RSIZETST,
14 INTEGER IPOSTPAD, IPREPAD, ISIZEHEEVX, ISIZESUBTST,
15 $ ISIZETST, RSIZECHK, RSIZEHEEVX, RSIZEQTQ,
16 $ RSIZESUBTST, RSIZETST, SIZEHEEVX, SIZEMQRLEFT,
17 $ SIZEMQRRIGHT, SIZEQRF, SIZESUBTST, SIZETMS,
68 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
69 $ MB_, NB_, RSRC_, CSRC_, LLD_
70 PARAMETER ( BLOCK_CYCLIC_2D = 1, dlen_ = 9, dtype_ = 1,
71 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
72 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
75 INTEGER ANB, CSRC_A, IACOL, IAROW, ICOFFA, ICTXT,
76 $ IROFFA, LCM, LCMQ, LDA, MQ0, MYCOL, MYROW, N,
77 $ NB, NEIG, NHEGST_LWOPT, NHETRD_LWOPT, NN, NNP,
78 $ NP, NP0, NPCOL, NPROW, NPS, NQ, NQ0, RSRC_A,
79 $ SIZECHK, SIZEQTQ, SQNPC
83 INTEGER ICEIL, ILCM, INDXG2P, NUMROC, PJLAENV
84 EXTERNAL ICEIL, ILCM, INDXG2P, NUMROC, PJLAENV
87 INTRINSIC DBLE, INT, MAX, SQRT
90 EXTERNAL blacs_gridinfo
94 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
99 rsrc_a = desca( rsrc_ )
100 csrc_a = desca( csrc_ )
103 CALL blacs_gridinfo( desca( ctxt_ ), nprow, npcol, myrow, mycol )
105 lcm = ilcm( nprow, npcol )
109 iarow = indxg2p( 1, nb, myrow, rsrc_a, nprow )
110 iacol = indxg2p( 1, nb, mycol, csrc_a, npcol )
111 np = numroc( n+iroffa, nb, myrow, iarow, nprow )
112 nq = numroc( n+icoffa, nb, mycol, iacol, npcol )
113 sizemqrleft = max( ( nb*( nb-1 ) ) / 2, ( np+nq )*nb ) + nb*nb
114 sizemqrright = max( ( nb*( nb-1 ) ) / 2,
115 $ ( nq+max( np+numroc( numroc( n+icoffa, nb, 0, 0,
116 $ npcol ), nb, 0, 0, lcmq ), np ) )*nb ) + nb*nb
117 sizeqrf = nb*np + nb*nq + nb*nb
118 sizetms = ( lda+1 )*max( 1, nq ) +
119 $ max( sizemqrleft, sizemqrright, sizeqrf )
121 np0 = numroc( n, desca( mb_ ), 0, 0, nprow )
122 mq0 = numroc( n, desca( nb_ ), 0, 0, npcol )
126 rsizechk = numroc( n, desca( nb_ ), mycol, 0, npcol )
130 np0 = numroc( nn, nb, 0, 0, nprow )
131 mq0 = numroc( max( neig, nb, 2 ), nb, 0, 0, npcol )
132 sizeheevx = n + ( np0+mq0+nb )*nb
133 rsizeheevx = 4*n + max( 5*nn, np0*mq0 ) +
134 $ iceil( neig, nprow*npcol )*nn
135 nnp = max( n, nprow*npcol+1, 4 )
138 ictxt = desca( ctxt_ )
139 anb = pjlaenv( ictxt, 3,
'PZHETTRD',
'L', 0, 0, 0, 0 )
140 sqnpc = int( sqrt( dble( nprow*npcol ) ) )
141 nps = max( numroc( n, 1, 0, 0, sqnpc ), 2*anb )
142 nhetrd_lwopt = 2*( anb+1 )*( 4*nps+2 ) + ( nps+2 )*nps
144 np0 = numroc( n, nb, 0, 0, nprow )
145 nq0 = numroc( n, nb, 0, 0, npcol )
146 nhegst_lwopt = 2*np0*nb + nq0*nb + nb*nb
147 sizeheevx = max( sizeheevx, n+nhetrd_lwopt, nhegst_lwopt )
149 sizesubtst = max( sizetms, sizeqtq, sizechk, sizeheevx ) +
151 rsizesubtst = max( rsizeheevx, rsizeqtq, rsizechk ) + iprepad +
153 isizesubtst = isizeheevx + iprepad + ipostpad
158 sizetst = 3*( lda*np+iprepad+ipostpad ) + sizesubtst
162 rsizetst = 4*( n+iprepad+ipostpad ) + rsizesubtst
166 isizetst = n + 2*nprow*npcol + 2*( iprepad+ipostpad ) +