1 SUBROUTINE pzlacp3( M, I, A, DESCA, B, LDB, II, JJ, REV )
9 INTEGER I, II, JJ, LDB, M, REV
13 COMPLEX*16 A( * ), B( LDB, * )
138 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
139 $ LLD_, MB_, M_, NB_, N_, RSRC_
140 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
141 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
142 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
144 parameter( zero = ( 0.0d+0, 0.0d+0 ) )
147 INTEGER COL, CONTXT, HBL, ICOL1, ICOL2, IDI, IDJ, IFIN,
148 $ III, IROW1, IROW2, ISTOP, ISTOPI, ISTOPJ, ITMP,
149 $ JJJ, LDA, MYCOL, MYROW, NPCOL, NPROW, ROW
156 EXTERNAL blacs_gridinfo,
infog1l, zgebr2d, zgebs2d,
168 contxt = desca( ctxt_ )
171 CALL blacs_gridinfo( contxt, nprow, npcol, myrow, mycol )
183 IF( mod( i+hbl, hbl ).NE.0 )
THEN
184 istop =
min( i+hbl-mod( i+hbl, hbl ), ifin )
190 IF( idj.LE.ifin )
THEN
194 IF( idi.LE.ifin )
THEN
196 row = mod( ( idi-1 ) / hbl, nprow )
197 col = mod( ( idj-1 ) / hbl, npcol )
198 CALL infog1l( idi, hbl, nprow, row, 0, irow1, itmp )
199 irow2 = numroc( istopi, hbl, row, 0, nprow )
200 CALL infog1l( idj, hbl, npcol, col, 0, icol1, itmp )
201 icol2 = numroc( istopj, hbl, col, 0, npcol )
202 IF( ( myrow.EQ.row ) .AND. ( mycol.EQ.col ) )
THEN
203 IF( ( ii.EQ.-1 ) .AND. ( jj.EQ.-1 ) )
THEN
208 CALL zgebs2d( contxt,
'All',
' ', irow2-irow1+1,
209 $ icol2-icol1+1, a( ( icol1-1 )*lda+
213 IF( ( ii.EQ.-1 ) .AND. ( jj.NE.-1 ) )
THEN
218 CALL zgebs2d( contxt,
'Col',
' ', irow2-irow1+1,
219 $ icol2-icol1+1, a( ( icol1-1 )*lda+
223 IF( ( ii.NE.-1 ) .AND. ( jj.EQ.-1 ) )
THEN
228 CALL zgebs2d( contxt,
'Row',
' ', irow2-irow1+1,
229 $ icol2-icol1+1, a( ( icol1-1 )*lda+
233 IF( ( ii.NE.-1 ) .AND. ( jj.NE.-1 ) .AND.
234 $ ( ( myrow.NE.ii ) .OR. ( mycol.NE.jj ) ) )
THEN
239 CALL zgesd2d( contxt, irow2-irow1+1, icol2-icol1+1,
240 $ a( ( icol1-1 )*lda+irow1 ), lda, ii,
243 CALL zgerv2d( contxt, irow2-irow1+1, icol2-icol1+1,
244 $ b( idi-i+1, idj-i+1 ), ldb, ii, jj )
248 DO 60 jjj = icol1, icol2
249 DO 50 iii = irow1, irow2
250 b( idi+iii-irow1+1-i, idj+jjj-icol1+1-i )
251 $ = a( ( jjj-1 )*lda+iii )
255 DO 80 jjj = icol1, icol2
256 DO 70 iii = irow1, irow2
257 a( ( jjj-1 )*lda+iii ) = b( idi+iii-irow1+1-i,
258 $ idj+jjj-icol1+1-i )
263 IF( ( ii.EQ.-1 ) .AND. ( jj.EQ.-1 ) )
THEN
265 CALL zgebr2d( contxt,
'All',
' ', irow2-irow1+1,
266 $ icol2-icol1+1, b( idi-i+1, idj-i+1 ),
270 IF( ( ii.EQ.-1 ) .AND. ( jj.EQ.mycol ) )
THEN
272 CALL zgebr2d( contxt,
'Col',
' ', irow2-irow1+1,
273 $ icol2-icol1+1, b( idi-i+1, idj-i+1 ),
277 IF( ( ii.EQ.myrow ) .AND. ( jj.EQ.-1 ) )
THEN
279 CALL zgebr2d( contxt,
'Row',
' ', irow2-irow1+1,
280 $ icol2-icol1+1, b( idi-i+1, idj-i+1 ),
284 IF( ( ii.EQ.myrow ) .AND. ( jj.EQ.mycol ) )
THEN
286 CALL zgerv2d( contxt, irow2-irow1+1, icol2-icol1+1,
287 $ b( idi-i+1, idj-i+1 ), ldb, row,
290 CALL zgesd2d( contxt, irow2-irow1+1, icol2-icol1+1,
291 $ b( idi-i+1, idj-i+1 ), ldb, row,
299 istopi =
min( istopi+hbl, ifin )
304 istopj =
min( istopj+hbl, ifin )