1 SUBROUTINE pspotrrv( UPLO, N, A, IA, JA, DESCA, WORK )
14 REAL 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.0e+0, zero = 0.0e+0 )
126 CHARACTER COLBTOP, ROWBTOP
127 INTEGER IACOL, IAROW, ICTXT, IL, J, JB, JL, JN, MYCOL,
128 $ MYROW, NPCOL, NPROW
130 INTEGER DESCW( DLEN_ )
134 $ pssyrk, pstrmm, pb_topget, pb_topset
138 INTEGER ICEIL, INDXG2P
139 EXTERNAL iceil, indxg2p, lsame
148 ictxt = desca( ctxt_ )
149 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
151 CALL pb_topget( ictxt,
'Broadcast',
'Rowwise', rowbtop )
152 CALL pb_topget( ictxt,
'Broadcast',
'Columnwise', colbtop )
154 upper = lsame( uplo,
'U' )
155 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
156 jl =
max( ( ( ja+n-2 ) / desca( nb_ ) ) * desca( nb_ ) + 1, ja )
157 il =
max( ( ( ia+n-2 ) / desca( mb_ ) ) * desca( mb_ ) + 1, ia )
158 iarow = indxg2p( il, desca( mb_ ), myrow, desca( rsrc_ ), nprow )
159 iacol = indxg2p( jl, desca( nb_ ), mycol, desca( csrc_ ), npcol )
163 CALL descset( descw, desca( mb_ ), desca( nb_ ), desca( mb_ ),
164 $ desca( nb_ ), iarow, iacol, ictxt, desca( mb_ ) )
170 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
' ' )
171 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
'S-ring' )
173 DO 10 j = jl, jn+1, -desca( nb_ )
175 jb =
min( ja+n-j, desca( nb_ ) )
179 CALL pssyrk(
'Upper',
'Transpose', ja+n-j-jb, jb, one, a, il,
180 $ j+jb, desca, one, a, il+jb, j+jb, desca )
184 CALL pslacpy(
'All', jb, jb, a, il, j, desca, work, 1, 1,
190 CALL pslaset(
'Lower', jb-1, jb, zero, zero, a, il+1, j,
195 CALL pstrmm(
'Left',
'Upper',
'Transpose',
'Non-Unit', jb,
196 $ n-j+ja, one, work, 1, 1, descw, a, il, j,
201 CALL pslacpy(
'Lower', jb-1, jb, work, 2, 1, descw, a,
204 il = il - desca( mb_ )
205 descw( rsrc_ ) = mod( descw( rsrc_ ) + nprow - 1, nprow )
206 descw( csrc_ ) = mod( descw( csrc_ ) + npcol - 1, npcol )
212 jb =
min( jn-ja+1, desca( nb_ ) )
216 CALL pssyrk(
'Upper',
'Transpose', n-jb, jb, one, a, ia, ja+jb,
217 $ desca, one, a, ia+jb, ja+jb, desca )
221 CALL pslacpy(
'All', jb, jb, a, ia, ja, desca, work, 1, 1,
227 CALL pslaset(
'Lower', jb-1, jb, zero, zero, a, ia+1, ja,
232 CALL pstrmm(
'Left',
'Upper',
'Transpose',
'Non-Unit', jb,
233 $ n, one, work, 1, 1, descw, a, ia, ja, desca )
237 CALL pslacpy(
'Lower', jb-1, jb, work, 2, 1, descw, a, ia+1,
244 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise',
'S-ring' )
245 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise',
' ' )
247 DO 20 j = jl, jn+1, -desca( nb_ )
249 jb =
min( ja+n-j, desca( nb_ ) )
253 CALL pssyrk(
'Lower',
'No transpose', ia+n-il-jb, jb, one, a,
254 $ il+jb, j, desca, one, a, il+jb, j+jb, desca )
258 CALL pslacpy(
'All', jb, jb, a, il, j, desca, work, 1, 1,
264 CALL pslaset(
'Upper', jb, jb-1, zero, zero, a, il, j+1,
269 CALL pstrmm(
'Right',
'Lower',
'Transpose',
'Non-Unit',
270 $ ia+n-il, jb, one, work, 1, 1, descw, a, il,
275 CALL pslacpy(
'Upper', jb, jb-1, work, 1, 2, descw, a,
278 il = il - desca( mb_ )
279 descw( rsrc_ ) = mod( descw( rsrc_ ) + nprow - 1, nprow )
280 descw( csrc_ ) = mod( descw( csrc_ ) + npcol - 1, npcol )
286 jb =
min( jn-ja+1, desca( nb_ ) )
290 CALL pssyrk(
'Lower',
'No transpose', n-jb, jb, one, a,
291 $ ia+jb, ja, desca, one, a, ia+jb, ja+jb, desca )
295 CALL pslacpy(
'All', jb, jb, a, ia, ja, desca, work, 1, 1,
301 CALL pslaset(
'Upper', jb, jb-1, zero, zero, a, ia, ja+1,
306 CALL pstrmm(
'Right',
'Lower',
'Transpose',
'Non-Unit', n, jb,
307 $ one, work, 1, 1, descw, a, ia, ja, desca )
311 CALL pslacpy(
'Upper', jb, jb-1, work, 1, 2, descw, a, ia,
316 CALL pb_topset( ictxt,
'Broadcast',
'Rowwise', rowbtop )
317 CALL pb_topset( ictxt,
'Broadcast',
'Columnwise', colbtop )