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

◆ pb_desctrans()

subroutine pb_desctrans ( integer, dimension( * )  descin,
integer, dimension( * )  descout 
)

Definition at line 3558 of file pblastim.f.

3559*
3560* -- PBLAS test routine (version 2.0) --
3561* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
3562* and University of California, Berkeley.
3563* April 1, 1998
3564*
3565* .. Array Arguments ..
3566 INTEGER DESCIN( * ), DESCOUT( * )
3567* ..
3568*
3569* Purpose
3570* =======
3571*
3572* PB_DESCTRANS converts a descriptor DESCIN of type BLOCK_CYCLIC_2D
3573* or BLOCK_CYCLIC_INB_2D into a descriptor DESCOUT of type
3574* BLOCK_CYCLIC_INB_2D.
3575*
3576* Notes
3577* =====
3578*
3579* A description vector is associated with each 2D block-cyclicly dis-
3580* tributed matrix. This vector stores the information required to
3581* establish the mapping between a matrix entry and its corresponding
3582* process and memory location.
3583*
3584* In the following comments, the character _ should be read as
3585* "of the distributed matrix". Let A be a generic term for any 2D
3586* block cyclicly distributed matrix. Its description vector is DESCA:
3587*
3588* NOTATION STORED IN EXPLANATION
3589* ---------------- --------------- -----------------------------------
3590* DTYPE_A (global) DESCA( DTYPE1_ ) The descriptor type.
3591* CTXT_A (global) DESCA( CTXT1_ ) The BLACS context handle indicating
3592* the NPROW x NPCOL BLACS process
3593* grid A is distributed over. The
3594* context itself is global, but the
3595* handle (the integer value) may
3596* vary.
3597* M_A (global) DESCA( M1_ ) The number of rows in the distri-
3598* buted matrix A, M_A >= 0.
3599* N_A (global) DESCA( N1_ ) The number of columns in the dis-
3600* tributed matrix A, N_A >= 0.
3601* MB_A (global) DESCA( MB1_ ) The blocking factor used to distri-
3602* bute the rows of A, MB_A > 0.
3603* NB_A (global) DESCA( NB1_ ) The blocking factor used to distri-
3604* bute the columns of A, NB_A > 0.
3605* RSRC_A (global) DESCA( RSRC1_ ) The process row over which the
3606* first row of the matrix A is dis-
3607* tributed, NPROW > RSRC_A >= 0.
3608* CSRC_A (global) DESCA( CSRC1_ ) The process column over which the
3609* first column of A is distributed.
3610* NPCOL > CSRC_A >= 0.
3611* LLD_A (local) DESCA( LLD1_ ) The leading dimension of the local
3612* array storing the local blocks of
3613* the distributed matrix A,
3614* IF( Lc( 1, N_A ) > 0 )
3615* LLD_A >= MAX( 1, Lr( 1, M_A ) )
3616* ELSE
3617* LLD_A >= 1.
3618*
3619* Let K be the number of rows of a matrix A starting at the global in-
3620* dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
3621* that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
3622* receive if these K rows were distributed over NPROW processes. If K
3623* is the number of columns of a matrix A starting at the global index
3624* JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
3625* lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
3626* these K columns were distributed over NPCOL processes.
3627*
3628* The values of Lr() and Lc() may be determined via a call to the func-
3629* tion PB_NUMROC:
3630* Lr( IA, K ) = PB_NUMROC( K, IA, MB_A, MB_A, MYROW, RSRC_A, NPROW )
3631* Lc( JA, K ) = PB_NUMROC( K, JA, NB_A, NB_A, MYCOL, CSRC_A, NPCOL )
3632*
3633* A description vector is associated with each 2D block-cyclicly dis-
3634* tributed matrix. This vector stores the information required to
3635* establish the mapping between a matrix entry and its corresponding
3636* process and memory location.
3637*
3638* In the following comments, the character _ should be read as
3639* "of the distributed matrix". Let A be a generic term for any 2D
3640* block cyclicly distributed matrix. Its description vector is DESCA:
3641*
3642* NOTATION STORED IN EXPLANATION
3643* ---------------- --------------- ------------------------------------
3644* DTYPE_A (global) DESCA( DTYPE_ ) The descriptor type.
3645* CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
3646* the NPROW x NPCOL BLACS process grid
3647* A is distributed over. The context
3648* itself is global, but the handle
3649* (the integer value) may vary.
3650* M_A (global) DESCA( M_ ) The number of rows in the distribu-
3651* ted matrix A, M_A >= 0.
3652* N_A (global) DESCA( N_ ) The number of columns in the distri-
3653* buted matrix A, N_A >= 0.
3654* IMB_A (global) DESCA( IMB_ ) The number of rows of the upper left
3655* block of the matrix A, IMB_A > 0.
3656* INB_A (global) DESCA( INB_ ) The number of columns of the upper
3657* left block of the matrix A,
3658* INB_A > 0.
3659* MB_A (global) DESCA( MB_ ) The blocking factor used to distri-
3660* bute the last M_A-IMB_A rows of A,
3661* MB_A > 0.
3662* NB_A (global) DESCA( NB_ ) The blocking factor used to distri-
3663* bute the last N_A-INB_A columns of
3664* A, NB_A > 0.
3665* RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
3666* row of the matrix A is distributed,
3667* NPROW > RSRC_A >= 0.
3668* CSRC_A (global) DESCA( CSRC_ ) The process column over which the
3669* first column of A is distributed.
3670* NPCOL > CSRC_A >= 0.
3671* LLD_A (local) DESCA( LLD_ ) The leading dimension of the local
3672* array storing the local blocks of
3673* the distributed matrix A,
3674* IF( Lc( 1, N_A ) > 0 )
3675* LLD_A >= MAX( 1, Lr( 1, M_A ) )
3676* ELSE
3677* LLD_A >= 1.
3678*
3679* Let K be the number of rows of a matrix A starting at the global in-
3680* dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
3681* that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
3682* receive if these K rows were distributed over NPROW processes. If K
3683* is the number of columns of a matrix A starting at the global index
3684* JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
3685* lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
3686* these K columns were distributed over NPCOL processes.
3687*
3688* The values of Lr() and Lc() may be determined via a call to the func-
3689* tion PB_NUMROC:
3690* Lr( IA, K ) = PB_NUMROC( K, IA, IMB_A, MB_A, MYROW, RSRC_A, NPROW )
3691* Lc( JA, K ) = PB_NUMROC( K, JA, INB_A, NB_A, MYCOL, CSRC_A, NPCOL )
3692*
3693* Arguments
3694* =========
3695*
3696* DESCIN (global and local input) INTEGER array
3697* On entry, DESCIN is an array of dimension DLEN1_ or DLEN_ as
3698* specified by its first entry DESCIN( DTYPE_ ). DESCIN is the
3699* source array descriptor of type BLOCK_CYCLIC_2D or of type
3700* BLOCK_CYCLIC_2D_INB.
3701*
3702* DESCOUT (global and local output) INTEGER array
3703* On entry, DESCOUT is an array of dimension DLEN_. DESCOUT is
3704* the target array descriptor of type BLOCK_CYCLIC_2D_INB.
3705*
3706* -- Written on April 1, 1998 by
3707* R. Clint Whaley, University of Tennessee, Knoxville 37996, USA.
3708*
3709* =====================================================================
3710*
3711* .. Parameters ..
3712 INTEGER BLOCK_CYCLIC_2D, CSRC1_, CTXT1_, DLEN1_,
3713 $ DTYPE1_, LLD1_, M1_, MB1_, N1_, NB1_, RSRC1_
3714 parameter( block_cyclic_2d = 1, dlen1_ = 9, dtype1_ = 1,
3715 $ ctxt1_ = 2, m1_ = 3, n1_ = 4, mb1_ = 5,
3716 $ nb1_ = 6, rsrc1_ = 7, csrc1_ = 8, lld1_ = 9 )
3717 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
3718 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
3719 $ RSRC_
3720 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
3721 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
3722 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
3723 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
3724* ..
3725* .. Local Scalars ..
3726 INTEGER I
3727* ..
3728* .. Executable Statements ..
3729*
3730 IF( descin( dtype_ ).EQ.block_cyclic_2d ) THEN
3731 descout( dtype_ ) = block_cyclic_2d_inb
3732 descout( ctxt_ ) = descin( ctxt1_ )
3733 descout( m_ ) = descin( m1_ )
3734 descout( n_ ) = descin( n1_ )
3735 descout( imb_ ) = descin( mb1_ )
3736 descout( inb_ ) = descin( nb1_ )
3737 descout( mb_ ) = descin( mb1_ )
3738 descout( nb_ ) = descin( nb1_ )
3739 descout( rsrc_ ) = descin( rsrc1_ )
3740 descout( csrc_ ) = descin( csrc1_ )
3741 descout( lld_ ) = descin( lld1_ )
3742 ELSE IF( descin( dtype_ ).EQ.block_cyclic_2d_inb ) THEN
3743 DO 10 i = 1, dlen_
3744 descout( i ) = descin( i )
3745 10 CONTINUE
3746 ELSE
3747 descout( dtype_ ) = descin( 1 )
3748 descout( ctxt_ ) = descin( 2 )
3749 descout( m_ ) = 0
3750 descout( n_ ) = 0
3751 descout( imb_ ) = 1
3752 descout( inb_ ) = 1
3753 descout( mb_ ) = 1
3754 descout( nb_ ) = 1
3755 descout( rsrc_ ) = 0
3756 descout( csrc_ ) = 0
3757 descout( lld_ ) = 1
3758 END IF
3759*
3760 RETURN
3761*
3762* End of PB_DESCTRANS
3763*