Routine: PZLACGV()  File: SRC\pzlacgv.f

 
 
# lines: 188
  # code: 188
  # comment: 0
  # blank:0
# Variables:33
# Callers:11
# Callings:0
# Words:58
# Keywords:35
 

 

..
     .. Array Arguments ..
     ..
  Purpose
  =======
  PZLACGV conjugates a complex vector of length N, sub( X ), where
  sub( X ) denotes X(IX,JX:JX+N-1) if INCX = DESCX( M_ ) and
  X(IX:IX+N-1,JX) if INCX = 1, and
  Notes
  =====
  Each global data object is described by an associated description
  vector.  This vector stores the information required to establish
  the mapping between an object element and its corresponding process
  and memory location.
  Let A be a generic term for any 2D block cyclicly distributed array.
  Such a global array has an associated description vector DESCA.
  In the following comments, the character _ should be read as
  "of the global array".
  NOTATION        STORED IN      EXPLANATION
  --------------- -------------- --------------------------------------
  DTYPE_A(global) DESCA( DTYPE_ )The descriptor type.  In this case,
                                 DTYPE_A = 1.
  CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
                                 the BLACS process grid A is distribu-
                                 ted over. The context itself is glo-
                                 bal, but the handle (the integer
                                 value) may vary.
  M_A    (global) DESCA( M_ )    The number of rows in the global
                                 array A.
  N_A    (global) DESCA( N_ )    The number of columns in the global
                                 array A.
  MB_A   (global) DESCA( MB_ )   The blocking factor used to distribute
                                 the rows of the array.
  NB_A   (global) DESCA( NB_ )   The blocking factor used to distribute
                                 the columns of the array.
  RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
                                 row of the array A is distributed.
  CSRC_A (global) DESCA( CSRC_ ) The process column over which the
                                 first column of the array A is
                                 distributed.
  LLD_A  (local)  DESCA( LLD_ )  The leading dimension of the local
                                 array.  LLD_A >= MAX(1,LOCr(M_A)).
  Let K be the number of rows or columns of a distributed matrix,
  and assume that its process grid has dimension p x q.
  LOCr( K ) denotes the number of elements of K that a process
  would receive if K were distributed over the p processes of its
  process column.
  Similarly, LOCc( K ) denotes the number of elements of K that a
  process would receive if K were distributed over the q processes of
  its process row.
  The values of LOCr() and LOCc() may be determined via a call to the
  ScaLAPACK tool function, NUMROC:
          LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ),
          LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ).
  An upper bound for these quantities may be computed by:
          LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
          LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A
  Because vectors may be viewed as a subclass of matrices, a
  distributed vector is considered to be a distributed matrix.
  Arguments
  =========
  N       (global input) INTEGER
          The length of the distributed vector sub( X ).
  X       (local input/local output) COMPLEX*16 pointer into the
          local memory to an array of dimension (LLD_X,*).
          On entry the vector to be conjugated
             x( i )  = X(IX+(JX-1)*M_X +(i-1)*INCX ), 1 <= i <= N.
          On exit the conjugated vector.
  IX      (global input) INTEGER
          The row index in the global array X indicating the first
          row of sub( X ).
  JX      (global input) INTEGER
          The column index in the global array X indicating the
          first column of sub( X ).
  DESCX   (global and local input) INTEGER array of dimension DLEN_.
          The array descriptor for the distributed matrix X.
  INCX    (global input) INTEGER
          The global increment for the elements of X. Only two values
          of INCX are supported in this version, namely 1 and M_X.
          INCX must not be zero.
  =====================================================================
     .. Parameters ..

 
Display dynamic version Find AutoScroll Reload FontSize: - + Hide Comments Hide Blanks Frame FullScreen MailPrint

 
01        SUBROUTINE PZLACGV( N , X , IX , JX , DESCX , INCX )
02  
03  *     -- ScaLAPACK auxiliary routine(version 1.7) --
04  *     University of Tennessee , Knoxville , Oak Ridge National Laboratory ,
05  *     and University of California , Berkeley.
06  *     May 1 , 1997
07  
08  *     .. Scalar Arguments ..
09        INTEGER INCX , IX , JX , N
10        INTEGER BLOCK_CYCLIC_2D , CSRC_ , CTXT_ , DLEN_ , DTYPE_ ,
11       $LLD_ , MB_ , M_ , NB_ , N_ , RSRC_
12        PARAMETER( BLOCK_CYCLIC_2D = 1 , DLEN_ = 9 , DTYPE_ = 1 ,
13       $CTXT_ = 2 , M_ = 3 , N_ = 4 , MB_ = 5 , NB_ = 6 ,
14       $RSRC_ = 7 , CSRC_ = 8 , LLD_ = 9 )
15  *     ..
16  *     .. Local Scalars ..
17        INTEGER I , ICOFFX , ICTXT , IIX , IOFFX , IROFFX , IXCOL ,
18       $IXROW , JJX , LDX , MYCOL , MYROW , NP , NPCOL ,
19       $NPROW , NQ
20  *     ..
21  *     .. External Subroutines ..
22        EXTERNAL BLACS_GRIDINFO , INFOG2L
23  *     ..
24  *     .. External Functions ..
25        INTEGER NUMROC
26        EXTERNAL NUMROC
27  *     ..
28  *     .. Intrinsic Functions ..
29        INTRINSIC DCONJG , MOD
30  *     ..
31  *     .. Executable Statements ..
32  
33  *     Get grid parameters.
34  
35        ICTXT = DESCX( CTXT_ )
36        CALL BLACS_GRIDINFO( ICTXT , NPROW , NPCOL , MYROW , MYCOL )
37  
38  *     Figure local indexes
39  
40        CALL INFOG2L( IX , JX , DESCX , NPROW , NPCOL , MYROW , MYCOL ,
41       $IIX , JJX , IXROW , IXCOL )
42  
43        LDX = DESCX( LLD_ )
44        IF( INCX.EQ.DESCX( M_ ) ) THEN
45  
46  *         sub( X ) is rowwise distributed.
47  
48            IF( MYROW.NE.IXROW )
49       $        RETURN
50                ICOFFX = MOD( JX - 1 , DESCX( NB_ ) )
51                NQ = NUMROC( N + ICOFFX , DESCX( NB_ ) , MYCOL , IXCOL , NPCOL )
52                IF( MYCOL.EQ.IXCOL )
53       $            NQ = NQ - ICOFFX
54  
55                    IF( NQ.GT.0 ) THEN
56                        IOFFX = IIX + (JJX - 1)*LDX
57                        DO 10 I = 1 , NQ
58                            X( IOFFX ) = DCONJG( X( IOFFX ) )
59                            IOFFX = IOFFX + LDX
60     10                 CONTINUE
61                    END IF
62  
63                ELSE IF( INCX.EQ.1 ) THEN
64  
65  *                 sub( X ) is columnwise distributed.
66  
67                    IF( MYCOL.NE.IXCOL )
68       $                RETURN
69                        IROFFX = MOD( IX - 1 , DESCX( MB_ ) )
70                        NP = NUMROC( N + IROFFX , DESCX( MB_ ) , MYROW , IXROW , NPROW )
71                        IF( MYROW.EQ.IXROW )
72       $                    NP = NP - IROFFX
73  
74                            IF( NP.GT.0 ) THEN
75                                IOFFX = IIX + (JJX - 1)*LDX
76                                DO 20 I = IOFFX , IOFFX + NP - 1
77                                    X( I ) = DCONJG( X( I ) )
78     20                         CONTINUE
79                            END IF
80  
81                        END IF
82  
83                        RETURN
84  
85  *                     End of PZLACGV
86  
87                    END