1 SUBROUTINE pzlasizesep( DESCA, IPREPAD, IPOSTPAD, SIZEMQRLEFT,
2 $ SIZEMQRRIGHT, SIZEQRF, SIZETMS, RSIZEQTQ,
3 $ RSIZECHK, SIZEHEEVX, RSIZEHEEVX,
4 $ ISIZEHEEVX, SIZEHEEVD, RSIZEHEEVD,
5 $ ISIZEHEEVD, SIZESUBTST, RSIZESUBTST,
6 $ ISIZESUBTST, SIZETST, RSIZETST, ISIZETST )
14 INTEGER IPOSTPAD, IPREPAD, ISIZEHEEVD, ISIZEHEEVX,
15 $ ISIZESUBTST, ISIZETST, RSIZECHK, RSIZEHEEVD,
16 $ RSIZEHEEVX, RSIZEQTQ, RSIZESUBTST, RSIZETST,
17 $ SIZEHEEVD, SIZEHEEVX, SIZEMQRLEFT,
18 $ SIZEMQRRIGHT, SIZEQRF, SIZESUBTST, SIZETMS,
74 INTEGER BLOCK_CYCLIC_2D, DLEN_, DTYPE_, CTXT_, M_, N_,
75 $ MB_, NB_, RSRC_, CSRC_, LLD_
76 PARAMETER ( BLOCK_CYCLIC_2D = 1, dlen_ = 9, dtype_ = 1,
77 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
78 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
81 INTEGER ANB, CSRC_A, IACOL, IAROW, ICOFFA, ICTXT,
82 $ IROFFA, LCM, LCMQ, LDA, MQ0, MYCOL, MYROW, N,
83 $ NB, NEIG, NHETRD_LWOPT, NN, NNP, NP, NP0,
84 $ NPCOL, NPROW, NPS, NQ, RSRC_A, SIZECHK,
88 INTEGER ICEIL, ILCM, INDXG2P, NUMROC, PJLAENV
89 EXTERNAL ICEIL, ILCM, INDXG2P, NUMROC, PJLAENV
94 EXTERNAL blacs_gridinfo
97 INTRINSIC dble, int,
max, sqrt
100 IF( block_cyclic_2d*csrc_*ctxt_*dlen_*dtype_*lld_*mb_*m_*nb_*n_*
105 rsrc_a = desca( rsrc_ )
106 csrc_a = desca( csrc_ )
109 CALL blacs_gridinfo( desca( ctxt_ ), nprow, npcol, myrow, mycol )
111 lcm = ilcm( nprow, npcol )
115 iarow = indxg2p( 1, nb, myrow, rsrc_a, nprow )
116 iacol = indxg2p( 1, nb, mycol, csrc_a, npcol )
117 np = numroc( n+iroffa, nb, myrow, iarow, nprow )
118 nq = numroc( n+icoffa, nb, mycol, iacol, npcol )
119 sizemqrleft =
max( ( nb*( nb-1 ) ) / 2, ( np+nq )*nb ) + nb*nb
120 sizemqrright =
max( ( nb*( nb-1 ) ) / 2,
121 $ ( nq+
max( np+numroc( numroc( n+icoffa, nb, 0, 0,
122 $ npcol ), nb, 0, 0, lcmq ), np ) )*nb ) + nb*nb
123 sizeqrf = nb*np + nb*nq + nb*nb
124 sizetms = ( lda+1 )*
max( 1, nq ) +
125 $
max( sizemqrleft, sizemqrright, sizeqrf )
127 np0 = numroc( n, desca( mb_ ), 0, 0, nprow )
128 mq0 = numroc( n, desca( nb_ ), 0, 0, npcol )
131 rsizeqtq = 2 +
max( desca( mb_ ), 2 )*( 2*np0+mq0 )
132 rsizechk = numroc( n, desca( nb_ ), mycol, 0, npcol )
136 np0 = numroc( nn, nb, 0, 0, nprow )
137 mq0 = numroc(
max( neig, nb, 2 ), nb, 0, 0, npcol )
138 sizeheevx = n + ( np0+mq0+nb )*nb
139 rsizeheevx = 4*n +
max( 5*nn, np0*mq0 ) +
140 $ iceil( neig, nprow*npcol )*nn
141 nnp =
max( n, nprow*npcol+1, 4 )
144 ictxt = desca( ctxt_ )
145 anb = pjlaenv( ictxt, 3,
'PZHETTRD',
'L', 0, 0, 0, 0 )
146 sqnpc = int( sqrt( dble( nprow*npcol ) ) )
147 nps =
max( numroc( n, 1, 0, 0, sqnpc ), 2*anb )
148 nhetrd_lwopt = 2*( anb+1 )*( 4*nps+2 ) + ( nps+2 )*nps
150 sizeheevx =
max( sizeheevx, n+nhetrd_lwopt )
152 sizeheevd = sizeheevx
153 rsizeheevd = 7*n + 3*np0*mq0
154 isizeheevd = 7*n + 8*npcol + 2
155 sizesubtst =
max( sizetms, sizeqtq, sizechk, sizeheevx,
156 $ sizeheevd ) + iprepad + ipostpad
157 rsizesubtst =
max( rsizeheevx, rsizeheevd, rsizeqtq, rsizechk ) +
159 isizesubtst =
max( isizeheevx, isizeheevd ) + iprepad + ipostpad
164 sizetst = 3*( lda*np+iprepad+ipostpad ) + sizesubtst
168 rsizetst = 4*( n+iprepad+ipostpad ) + rsizesubtst
172 isizetst = n + 2*nprow*npcol + 2*( iprepad+ipostpad ) +