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

◆ pb_pzlaprnt()

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

Definition at line 9302 of file pzblastst.f.

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