1 SUBROUTINE pilaprnt( M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
10 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT
15 INTEGER A( * ), WORK( * )
124 INTEGER BLOCK_CYCLIC_2D, CSRC_, CTXT_, DLEN_, DTYPE_,
125 $ lld_, mb_, m_, nb_, n_, rsrc_
126 parameter( block_cyclic_2d = 1, dlen_ = 9, dtype_ = 1,
127 $ ctxt_ = 2, m_ = 3, n_ = 4, mb_ = 5, nb_ = 6,
128 $ rsrc_ = 7, csrc_ = 8, lld_ = 9 )
131 INTEGER H, I, IACOL, IAROW, IB, ICTXT, ICURCOL,
132 $ icurrow, ii, iia, in, j, jb, jj, jja, jn, k,
133 $ lda, mycol, myrow, npcol, nprow
136 EXTERNAL blacs_barrier, blacs_gridinfo,
infog2l,
150 ictxt = desca( ctxt_ )
151 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
153 CALL infog2l( ia, ja, desca, nprow, npcol, myrow, mycol,
154 $ iia, jja, iarow, iacol )
163 jn =
min( iceil( ja, desca( nb_ ) ) * desca( nb_ ), ja+n-1 )
166 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+m-1 )
168 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
169 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
171 WRITE( nout, fmt = 9999 )
172 $ cmatnm, ia+k, ja+h, a( ii+k+(jj+h-1)*lda )
176 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
177 CALL igesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ), lda,
179 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
180 CALL igerv2d( ictxt, ib, 1, work, desca( mb_ ),
183 WRITE( nout, fmt = 9999 )
184 $ cmatnm, ia+k-1, ja+h, work( k )
188 IF( myrow.EQ.icurrow )
190 icurrow = mod( icurrow+1, nprow )
191 CALL blacs_barrier( ictxt,
'All' )
195 DO 50 i = in+1, ia+m-1, desca( mb_ )
196 ib =
min( desca( mb_ ), ia+m-i )
197 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
198 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
200 WRITE( nout, fmt = 9999 )
201 $ cmatnm, i+k, ja+h, a( ii+k+(jj+h-1)*lda )
205 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
206 CALL igesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
207 $ lda, irprnt, icprnt )
208 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
209 CALL igerv2d( ictxt, ib, 1, work, desca( mb_ ),
212 WRITE( nout, fmt = 9999 )
213 $ cmatnm, i+k-1, ja+h, work( k )
217 IF( myrow.EQ.icurrow )
219 icurrow = mod( icurrow+1, nprow )
220 CALL blacs_barrier( ictxt,
'All' )
227 IF( mycol.EQ.icurcol )
229 icurcol = mod( icurcol+1, npcol )
230 CALL blacs_barrier( ictxt,
'All' )
234 DO 130 j = jn+1, ja+n-1, desca( nb_ )
235 jb =
min( desca( nb_ ), ja+n-j )
237 in =
min( iceil( ia, desca( mb_ ) ) * desca( mb_ ), ia+m-1 )
239 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
240 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
242 WRITE( nout, fmt = 9999 )
243 $ cmatnm, ia+k, j+h, a( ii+k+(jj+h-1)*lda )
247 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
248 CALL igesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
249 $ lda, irprnt, icprnt )
250 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
251 CALL igerv2d( ictxt, ib, 1, work, desca( mb_ ),
254 WRITE( nout, fmt = 9999 )
255 $ cmatnm, ia+k-1, j+h, work( k )
259 IF( myrow.EQ.icurrow )
261 icurrow = mod( icurrow+1, nprow )
262 CALL blacs_barrier( ictxt,
'All' )
266 DO 110 i = in+1, ia+m-1, desca( mb_ )
267 ib =
min( desca( mb_ ), ia+m-i )
268 IF( icurrow.EQ.irprnt .AND. icurcol.EQ.icprnt )
THEN
269 IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
271 WRITE( nout, fmt = 9999 )
272 $ cmatnm, i+k, j+h, a( ii+k+(jj+h-1)*lda )
276 IF( myrow.EQ.icurrow .AND. mycol.EQ.icurcol )
THEN
277 CALL igesd2d( ictxt, ib, 1, a( ii+(jj+h-1)*lda ),
278 $ lda, irprnt, icprnt )
279 ELSE IF( myrow.EQ.irprnt .AND. mycol.EQ.icprnt )
THEN
280 CALL igerv2d( ictxt, ib, 1, work, desca( mb_ ),
283 WRITE( nout, fmt = 9999 )
284 $ cmatnm, i+k-1, j+h, work( k )
288 IF( myrow.EQ.icurrow )
290 icurrow = mod( icurrow+1, nprow )
291 CALL blacs_barrier( ictxt,
'All' )
298 IF( mycol.EQ.icurcol )
300 icurcol = mod( icurcol+1, npcol )
301 CALL blacs_barrier( ictxt,
'All' )
305 9999
FORMAT(a,
'(',i6,
',',i6,
')=',i8)