1 SUBROUTINE pslacp3( M, I, A, DESCA, B, LDB, II, JJ, REV )
10 INTEGER I, II, JJ, LDB, M, REV
14 REAL A( * ), B( LDB, * )
136 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
137 $ LLD_, MB_, M_, NB_, N_, RSRC_
138 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
139 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
140 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
142 parameter( zero = 0.0 )
145 INTEGER COL, CONTXT, HBL, IAFIRST, ICOL1, ICOL2, IDI,
146 $ IDJ, IFIN, III, IROW1, IROW2, ISTOP, ISTOPI,
147 $ ISTOPJ, ITMP, JAFIRST, JJJ, LDA, MYCOL, MYROW,
155 EXTERNAL blacs_gridinfo, sgebr2d, sgebs2d, sgerv2d,
167 contxt = desca( ctxt_ )
169 iafirst = desca( rsrc_ )
170 jafirst = desca( csrc_ )
172 CALL blacs_gridinfo( contxt, nprow, npcol, myrow, mycol )
184 IF( mod( i+hbl, hbl ).NE.0 )
THEN
185 istop =
min( i+hbl-mod( i+hbl, hbl ), ifin )
191 IF( idj.LE.ifin )
THEN
195 IF( idi.LE.ifin )
THEN
197 row = mod( ( idi-1 ) / hbl + iafirst, nprow )
198 col = mod( ( idj-1 ) / hbl + jafirst, npcol )
199 CALL infog1l( idi, hbl, nprow, row, iafirst, irow1, itmp )
200 irow2 = numroc( istopi, hbl, row, iafirst, nprow )
201 CALL infog1l( idj, hbl, npcol, col, jafirst, icol1, itmp )
202 icol2 = numroc( istopj, hbl, col, jafirst, npcol )
203 IF( ( myrow.EQ.row ) .AND. ( mycol.EQ.col ) )
THEN
204 IF( ( ii.EQ.-1 ) .AND. ( jj.EQ.-1 ) )
THEN
209 CALL sgebs2d( contxt,
'All',
' ', irow2-irow1+1,
210 $ icol2-icol1+1, a( ( icol1-1 )*lda+
214 IF( ( ii.EQ.-1 ) .AND. ( jj.NE.-1 ) )
THEN
219 CALL sgebs2d( contxt,
'Col',
' ', irow2-irow1+1,
220 $ icol2-icol1+1, a( ( icol1-1 )*lda+
224 IF( ( ii.NE.-1 ) .AND. ( jj.EQ.-1 ) )
THEN
229 CALL sgebs2d( contxt,
'Row',
' ', irow2-irow1+1,
230 $ icol2-icol1+1, a( ( icol1-1 )*lda+
234 IF( ( ii.NE.-1 ) .AND. ( jj.NE.-1 ) .AND.
235 $ ( ( myrow.NE.ii ) .OR. ( mycol.NE.jj ) ) )
THEN
240 CALL sgesd2d( contxt, irow2-irow1+1, icol2-icol1+1,
241 $ a( ( icol1-1 )*lda+irow1 ), lda, ii,
244 CALL sgerv2d( contxt, irow2-irow1+1, icol2-icol1+1,
245 $ b( idi-i+1, idj-i+1 ), ldb, ii, jj )
249 DO 60 jjj = icol1, icol2
250 DO 50 iii = irow1, irow2
251 b( idi+iii-irow1+1-i, idj+jjj-icol1+1-i )
252 $ = a( ( jjj-1 )*lda+iii )
256 DO 80 jjj = icol1, icol2
257 DO 70 iii = irow1, irow2
258 a( ( jjj-1 )*lda+iii ) = b( idi+iii-irow1+1-i,
259 $ idj+jjj-icol1+1-i )
264 IF( ( ii.EQ.-1 ) .AND. ( jj.EQ.-1 ) )
THEN
266 CALL sgebr2d( contxt,
'All',
' ', irow2-irow1+1,
267 $ icol2-icol1+1, b( idi-i+1, idj-i+1 ),
271 IF( ( ii.EQ.-1 ) .AND. ( jj.EQ.mycol ) )
THEN
273 CALL sgebr2d( contxt,
'Col',
' ', irow2-irow1+1,
274 $ icol2-icol1+1, b( idi-i+1, idj-i+1 ),
278 IF( ( ii.EQ.myrow ) .AND. ( jj.EQ.-1 ) )
THEN
280 CALL sgebr2d( contxt,
'Row',
' ', irow2-irow1+1,
281 $ icol2-icol1+1, b( idi-i+1, idj-i+1 ),
285 IF( ( ii.EQ.myrow ) .AND. ( jj.EQ.mycol ) )
THEN
287 CALL sgerv2d( contxt, irow2-irow1+1, icol2-icol1+1,
288 $ b( idi-i+1, idj-i+1 ), ldb, row,
291 CALL sgesd2d( contxt, irow2-irow1+1, icol2-icol1+1,
292 $ b( idi-i+1, idj-i+1 ), ldb, row,
300 istopi =
min( istopi+hbl, ifin )
305 istopj =
min( istopj+hbl, ifin )