1 SUBROUTINE pzpotrrv( UPLO, N, A, IA, JA, DESCA, WORK )
14 COMPLEX*16 A( * ), WORK( * )
116 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
117 $ LLD_, MB_, M_, NB_, N_, RSRC_
118 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
119 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
120 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
122 parameter( one = 1.0d+0 )
123 COMPLEX*16 CONE, ZERO
124 parameter( cone = ( 1.0d+0, 0.0d+0 ),
125 $ zero = ( 0.0d+0, 0.0d+0 ) )
129 CHARACTER COLBTOP, ROWBTOP
130 INTEGER IACOL, IAROW, ICTXT, IL, J, JB, JL, JN, MYCOL,
131 $ MYROW, NPCOL, NPROW
133 INTEGER DESCW( DLEN_ )
136 EXTERNAL blacs_gridinfo,
descset, pb_topget, pb_topset,
141 INTEGER ICEIL, INDXG2P
142 EXTERNAL iceil, indxg2p, lsame
151 ictxt = desca( ctxt_ )
152 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
154 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
155 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
157 upper = lsame( uplo,
'U' )
158 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
159 jl =
max( ( ( ja+n-2 ) / desca( nb_ ) ) * desca( nb_ ) + 1, ja )
160 il =
max( ( ( ia+n-2 ) / desca( mb_ ) ) * desca( mb_ ) + 1, ia )
161 iarow = indxg2p( il, desca( mb_ ), myrow, desca( rsrc_ ), nprow )
162 iacol = indxg2p( jl, desca( nb_ ), mycol, desca( csrc_ ), npcol )
166 CALL descset( descw, desca( mb_ ), desca( nb_ ), desca( mb_ ),
167 $ desca( nb_ ), iarow, iacol, ictxt, desca( mb_ ) )
173 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
174 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'S-ring' )
176 DO 10 j = jl, jn+1, -desca( nb_ )
178 jb =
min( ja+n-j, desca( nb_ ) )
182 CALL pzherk(
'Upper',
'Conjugate Transpose', ja+n-j-jb, jb,
183 $ one, a, il, j+jb, desca, one, a, il+jb, j+jb,
188 CALL pzlacpy(
'All', jb, jb, a, il, j, desca, work, 1, 1,
194 CALL pzlaset(
'Lower', jb-1, jb, zero, zero, a, il+1, j,
199 CALL pztrmm(
'Left',
'Upper',
'Conjugate Transpose',
200 $
'Non-Unit', jb, n-j+ja, cone, work, 1, 1,
201 $ descw, a, il, j, desca )
205 CALL pzlacpy(
'Lower', jb-1, jb, work, 2, 1, descw, a,
208 il = il - desca( mb_ )
209 descw( rsrc_ ) = mod( descw( rsrc_ ) + nprow - 1, nprow )
210 descw( csrc_ ) = mod( descw( csrc_ ) + npcol - 1, npcol )
216 jb =
min( jn-ja+1, desca( nb_ ) )
220 CALL pzherk(
'Upper',
'Conjugate Transpose', n-jb, jb, one, a,
221 $ ia, ja+jb, desca, one, a, ia+jb, ja+jb, desca )
225 CALL pzlacpy(
'All', jb, jb, a, ia, ja, desca, work, 1, 1,
231 CALL pzlaset(
'Lower', jb-1, jb, zero, zero, a, ia+1, ja,
236 CALL pztrmm(
'Left',
'Upper',
'Conjugate Transpose',
'Non-Unit',
237 $ jb, n, cone, work, 1, 1, descw, a, ia, ja, desca )
241 CALL pzlacpy(
'Lower', jb-1, jb, work, 2, 1, descw, a, ia+1,
248 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'S-ring' )
249 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
251 DO 20 j = jl, jn+1, -desca( nb_ )
253 jb =
min( ja+n-j, desca( nb_ ) )
257 CALL pzherk(
'Lower',
'No Transpose', ia+n-il-jb, jb, one, a,
258 $ il+jb, j, desca, one, a, il+jb, j+jb, desca )
262 CALL pzlacpy(
'All', jb, jb, a, il, j, desca, work, 1, 1,
268 CALL pzlaset(
'Upper', jb, jb-1, zero, zero, a, il, j+1,
273 CALL pztrmm(
'Right',
'Lower',
'Conjugate transpose',
274 $
'Non-Unit', ia+n-il, jb, cone, work, 1, 1,
275 $ descw, a, il, j, desca )
279 CALL pzlacpy(
'Upper', jb, jb-1, work, 1, 2, descw, a,
282 il = il - desca( mb_ )
283 descw( rsrc_ ) = mod( descw( rsrc_ ) + nprow - 1, nprow )
284 descw( csrc_ ) = mod( descw( csrc_ ) + npcol - 1, npcol )
290 jb =
min( jn-ja+1, desca( nb_ ) )
294 CALL pzherk(
'Lower',
'No Transpose', n-jb, jb, one, a,
295 $ ia+jb, ja, desca, one, a, ia+jb, ja+jb, desca )
299 CALL pzlacpy(
'All', jb, jb, a, ia, ja, desca, work, 1, 1,
305 CALL pzlaset(
'Upper', jb, jb-1, zero, zero, a, ia, ja+1,
310 CALL pztrmm(
'Right',
'Lower',
'Conjugate transpose',
311 $
'Non-Unit', n, jb, cone, work, 1, 1, descw, a,
316 CALL pzlacpy(
'Upper', jb, jb-1, work, 1, 2, descw, a, ia,
321 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
322 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )