SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_pclaprnt()

subroutine pb_pclaprnt ( integer  m,
integer  n,
complex, dimension( * )  a,
integer  ia,
integer  ja,
integer, dimension( * )  desca,
integer  irprnt,
integer  icprnt,
character*(*)  cmatnm,
integer  nout,
complex, dimension( * )  work 
)

Definition at line 9300 of file pcblastst.f.

9302*
9303* -- PBLAS test routine (version 2.0) --
9304* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
9305* and University of California, Berkeley.
9306* April 1, 1998
9307*
9308* .. Scalar Arguments ..
9309 INTEGER IA, ICPRNT, IRPRNT, JA, M, N, NOUT
9310* ..
9311* .. Array Arguments ..
9312 CHARACTER*(*) CMATNM
9313 INTEGER DESCA( * )
9314 COMPLEX A( * ), WORK( * )
9315* ..
9316*
9317* Purpose
9318* =======
9319*
9320* PB_PCLAPRNT prints to the standard output a submatrix sub( A ) deno-
9321* ting A(IA:IA+M-1,JA:JA+N-1). The local pieces are sent and printed by
9322* the process of coordinates (IRPRNT, ICPRNT).
9323*
9324* Notes
9325* =====
9326*
9327* A description vector is associated with each 2D block-cyclicly dis-
9328* tributed matrix. This vector stores the information required to
9329* establish the mapping between a matrix entry and its corresponding
9330* process and memory location.
9331*
9332* In the following comments, the character _ should be read as
9333* "of the distributed matrix". Let A be a generic term for any 2D
9334* block cyclicly distributed matrix. Its description vector is DESCA:
9335*
9336* NOTATION STORED IN EXPLANATION
9337* ---------------- --------------- ------------------------------------
9338* DTYPE_A (global) DESCA( DTYPE_ ) The descriptor type.
9339* CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
9340* the NPROW x NPCOL BLACS process grid
9341* A is distributed over. The context
9342* itself is global, but the handle
9343* (the integer value) may vary.
9344* M_A (global) DESCA( M_ ) The number of rows in the distribu-
9345* ted matrix A, M_A >= 0.
9346* N_A (global) DESCA( N_ ) The number of columns in the distri-
9347* buted matrix A, N_A >= 0.
9348* IMB_A (global) DESCA( IMB_ ) The number of rows of the upper left
9349* block of the matrix A, IMB_A > 0.
9350* INB_A (global) DESCA( INB_ ) The number of columns of the upper
9351* left block of the matrix A,
9352* INB_A > 0.
9353* MB_A (global) DESCA( MB_ ) The blocking factor used to distri-
9354* bute the last M_A-IMB_A rows of A,
9355* MB_A > 0.
9356* NB_A (global) DESCA( NB_ ) The blocking factor used to distri-
9357* bute the last N_A-INB_A columns of
9358* A, NB_A > 0.
9359* RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
9360* row of the matrix A is distributed,
9361* NPROW > RSRC_A >= 0.
9362* CSRC_A (global) DESCA( CSRC_ ) The process column over which the
9363* first column of A is distributed.
9364* NPCOL > CSRC_A >= 0.
9365* LLD_A (local) DESCA( LLD_ ) The leading dimension of the local
9366* array storing the local blocks of
9367* the distributed matrix A,
9368* IF( Lc( 1, N_A ) > 0 )
9369* LLD_A >= MAX( 1, Lr( 1, M_A ) )
9370* ELSE
9371* LLD_A >= 1.
9372*
9373* Let K be the number of rows of a matrix A starting at the global in-
9374* dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
9375* that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
9376* receive if these K rows were distributed over NPROW processes. If K
9377* is the number of columns of a matrix A starting at the global index
9378* JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
9379* lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
9380* these K columns were distributed over NPCOL processes.
9381*
9382* The values of Lr() and Lc() may be determined via a call to the func-
9383* tion PB_NUMROC:
9384* Lr( IA, K ) = PB_NUMROC( K, IA, IMB_A, MB_A, MYROW, RSRC_A, NPROW )
9385* Lc( JA, K ) = PB_NUMROC( K, JA, INB_A, NB_A, MYCOL, CSRC_A, NPCOL )
9386*
9387* Arguments
9388* =========
9389*
9390* M (global input) INTEGER
9391* On entry, M specifies the number of rows of the submatrix
9392* sub( A ). M must be at least zero.
9393*
9394* N (global input) INTEGER
9395* On entry, N specifies the number of columns of the submatrix
9396* sub( A ). N must be at least zero.
9397*
9398* A (local input) COMPLEX array
9399* On entry, A is an array of dimension (LLD_A, Ka), where Ka is
9400* at least Lc( 1, JA+N-1 ). Before entry, this array contains
9401* the local entries of the matrix A.
9402*
9403* IA (global input) INTEGER
9404* On entry, IA specifies A's global row index, which points to
9405* the beginning of the submatrix sub( A ).
9406*
9407* JA (global input) INTEGER
9408* On entry, JA specifies A's global column index, which points
9409* to the beginning of the submatrix sub( A ).
9410*
9411* DESCA (global and local input) INTEGER array
9412* On entry, DESCA is an integer array of dimension DLEN_. This
9413* is the array descriptor for the matrix A.
9414*
9415* IRPRNT (global input) INTEGER
9416* On entry, IRPRNT specifies the row index of the printing pro-
9417* cess.
9418*
9419* ICPRNT (global input) INTEGER
9420* On entry, ICPRNT specifies the column index of the printing
9421* process.
9422*
9423* CMATNM (global input) CHARACTER*(*)
9424* On entry, CMATNM is the name of the matrix to be printed.
9425*
9426* NOUT (global input) INTEGER
9427* On entry, NOUT specifies the output unit number. When NOUT is
9428* equal to 6, the submatrix is printed on the screen.
9429*
9430* WORK (local workspace) COMPLEX array
9431* On entry, WORK is a work array of dimension at least equal to
9432* MAX( IMB_A, MB_A ).
9433*
9434* -- Written on April 1, 1998 by
9435* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
9436*
9437* =====================================================================
9438*
9439* .. Parameters ..
9440 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
9441 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
9442 $ RSRC_
9443 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
9444 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
9445 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
9446 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
9447* ..
9448* .. Local Scalars ..
9449 INTEGER MYCOL, MYROW, NPCOL, NPROW, PCOL, PROW
9450* ..
9451* .. Local Arrays ..
9452 INTEGER DESCA2( DLEN_ )
9453* ..
9454* .. External Subroutines ..
9455 EXTERNAL blacs_gridinfo, pb_desctrans, pb_pclaprn2
9456* ..
9457* .. Executable Statements ..
9458*
9459* Quick return if possible
9460*
9461 IF( ( m.LE.0 ).OR.( n.LE.0 ) )
9462 $ RETURN
9463*
9464* Convert descriptor
9465*
9466 CALL pb_desctrans( desca, desca2 )
9467*
9468 CALL blacs_gridinfo( desca2( ctxt_ ), nprow, npcol, myrow, mycol )
9469*
9470 IF( desca2( rsrc_ ).GE.0 ) THEN
9471 IF( desca2( csrc_ ).GE.0 ) THEN
9472 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt, icprnt,
9473 $ cmatnm, nout, desca2( rsrc_ ),
9474 $ desca2( csrc_ ), work )
9475 ELSE
9476 DO 10 pcol = 0, npcol - 1
9477 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9478 $ WRITE( nout, * ) 'Colum-replicated array -- ' ,
9479 $ 'copy in process column: ', pcol
9480 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt,
9481 $ icprnt, cmatnm, nout, desca2( rsrc_ ),
9482 $ pcol, work )
9483 10 CONTINUE
9484 END IF
9485 ELSE
9486 IF( desca2( csrc_ ).GE.0 ) THEN
9487 DO 20 prow = 0, nprow - 1
9488 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9489 $ WRITE( nout, * ) 'Row-replicated array -- ' ,
9490 $ 'copy in process row: ', prow
9491 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt,
9492 $ icprnt, cmatnm, nout, prow,
9493 $ desca2( csrc_ ), work )
9494 20 CONTINUE
9495 ELSE
9496 DO 40 prow = 0, nprow - 1
9497 DO 30 pcol = 0, npcol - 1
9498 IF( ( myrow.EQ.irprnt ).AND.( mycol.EQ.icprnt ) )
9499 $ WRITE( nout, * ) 'Replicated array -- ' ,
9500 $ 'copy in process (', prow, ',', pcol, ')'
9501 CALL pb_pclaprn2( m, n, a, ia, ja, desca2, irprnt,
9502 $ icprnt, cmatnm, nout, prow, pcol,
9503 $ work )
9504 30 CONTINUE
9505 40 CONTINUE
9506 END IF
9507 END IF
9508*
9509 RETURN
9510*
9511* End of PB_PCLAPRNT
9512*
subroutine pb_desctrans(descin, descout)
Definition pblastst.f:2964
subroutine pb_pclaprn2(m, n, a, ia, ja, desca, irprnt, icprnt, cmatnm, nout, prow, pcol, work)
Definition pcblastst.f:9516
Here is the caller graph for this function: