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

◆ pisinscope()

logical function pisinscope ( integer  ictxt,
integer  n,
integer  ix,
integer  jx,
integer, dimension( * )  descx,
integer  incx 
)

Definition at line 2033 of file pdblas1tst.f.

2034*
2035* -- PBLAS test routine (version 2.0) --
2036* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
2037* and University of California, Berkeley.
2038* April 1, 1998
2039*
2040* .. Scalar Arguments ..
2041 INTEGER ICTXT, INCX, IX, JX, N
2042* ..
2043* .. Array Arguments ..
2044 INTEGER DESCX( * )
2045* ..
2046*
2047* Purpose
2048* =======
2049*
2050* PISINSCOPE returns .TRUE. if the calling process is in the scope of
2051* sub( X ) = X( IX+(JX-1)*DESCX(M_)+(i-1)*INCX ) and .FALSE. if it is
2052* not. This routine is used to determine which processes should check
2053* the answer returned by some Level 1 PBLAS routines.
2054*
2055* Notes
2056* =====
2057*
2058* A description vector is associated with each 2D block-cyclicly dis-
2059* tributed matrix. This vector stores the information required to
2060* establish the mapping between a matrix entry and its corresponding
2061* process and memory location.
2062*
2063* In the following comments, the character _ should be read as
2064* "of the distributed matrix". Let A be a generic term for any 2D
2065* block cyclicly distributed matrix. Its description vector is DESCA:
2066*
2067* NOTATION STORED IN EXPLANATION
2068* ---------------- --------------- ------------------------------------
2069* DTYPE_A (global) DESCA( DTYPE_ ) The descriptor type.
2070* CTXT_A (global) DESCA( CTXT_ ) The BLACS context handle, indicating
2071* the NPROW x NPCOL BLACS process grid
2072* A is distributed over. The context
2073* itself is global, but the handle
2074* (the integer value) may vary.
2075* M_A (global) DESCA( M_ ) The number of rows in the distribu-
2076* ted matrix A, M_A >= 0.
2077* N_A (global) DESCA( N_ ) The number of columns in the distri-
2078* buted matrix A, N_A >= 0.
2079* IMB_A (global) DESCA( IMB_ ) The number of rows of the upper left
2080* block of the matrix A, IMB_A > 0.
2081* INB_A (global) DESCA( INB_ ) The number of columns of the upper
2082* left block of the matrix A,
2083* INB_A > 0.
2084* MB_A (global) DESCA( MB_ ) The blocking factor used to distri-
2085* bute the last M_A-IMB_A rows of A,
2086* MB_A > 0.
2087* NB_A (global) DESCA( NB_ ) The blocking factor used to distri-
2088* bute the last N_A-INB_A columns of
2089* A, NB_A > 0.
2090* RSRC_A (global) DESCA( RSRC_ ) The process row over which the first
2091* row of the matrix A is distributed,
2092* NPROW > RSRC_A >= 0.
2093* CSRC_A (global) DESCA( CSRC_ ) The process column over which the
2094* first column of A is distributed.
2095* NPCOL > CSRC_A >= 0.
2096* LLD_A (local) DESCA( LLD_ ) The leading dimension of the local
2097* array storing the local blocks of
2098* the distributed matrix A,
2099* IF( Lc( 1, N_A ) > 0 )
2100* LLD_A >= MAX( 1, Lr( 1, M_A ) )
2101* ELSE
2102* LLD_A >= 1.
2103*
2104* Let K be the number of rows of a matrix A starting at the global in-
2105* dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
2106* that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
2107* receive if these K rows were distributed over NPROW processes. If K
2108* is the number of columns of a matrix A starting at the global index
2109* JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
2110* lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
2111* these K columns were distributed over NPCOL processes.
2112*
2113* The values of Lr() and Lc() may be determined via a call to the func-
2114* tion PB_NUMROC:
2115* Lr( IA, K ) = PB_NUMROC( K, IA, IMB_A, MB_A, MYROW, RSRC_A, NPROW )
2116* Lc( JA, K ) = PB_NUMROC( K, JA, INB_A, NB_A, MYCOL, CSRC_A, NPCOL )
2117*
2118* Arguments
2119* =========
2120*
2121* ICTXT (local input) INTEGER
2122* On entry, ICTXT specifies the BLACS context handle, indica-
2123* ting the global context of the operation. The context itself
2124* is global, but the value of ICTXT is local.
2125*
2126* N (global input) INTEGER
2127* The length of the subvector sub( X ).
2128*
2129* IX (global input) INTEGER
2130* On entry, IX specifies X's global row index, which points to
2131* the beginning of the submatrix sub( X ).
2132*
2133* JX (global input) INTEGER
2134* On entry, JX specifies X's global column index, which points
2135* to the beginning of the submatrix sub( X ).
2136*
2137* DESCX (global and local input) INTEGER array
2138* On entry, DESCX is an integer array of dimension DLEN_. This
2139* is the array descriptor for the matrix X.
2140*
2141* INCX (global input) INTEGER
2142* On entry, INCX specifies the global increment for the
2143* elements of X. Only two values of INCX are supported in
2144* this version, namely 1 and M_X. INCX must not be zero.
2145*
2146* -- Written on April 1, 1998 by
2147* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
2148*
2149* =====================================================================
2150*
2151* .. Parameters ..
2152 INTEGER BLOCK_CYCLIC_2D_INB, CSRC_, CTXT_, DLEN_,
2153 $ DTYPE_, IMB_, INB_, LLD_, MB_, M_, NB_, N_,
2154 $ RSRC_
2155 parameter( block_cyclic_2d_inb = 2, dlen_ = 11,
2156 $ dtype_ = 1, ctxt_ = 2, m_ = 3, n_ = 4,
2157 $ imb_ = 5, inb_ = 6, mb_ = 7, nb_ = 8,
2158 $ rsrc_ = 9, csrc_ = 10, lld_ = 11 )
2159* ..
2160* .. Local Scalars ..
2161 LOGICAL COLREP, ROWREP
2162 INTEGER IIX, IXCOL, IXROW, JJX, MYCOL, MYROW, NPCOL,
2163 $ NPROW
2164* ..
2165* .. External Subroutines ..
2166 EXTERNAL blacs_gridinfo, pb_infog2l
2167* ..
2168* .. Executable Statements ..
2169*
2170 CALL blacs_gridinfo( ictxt, nprow, npcol, myrow, mycol )
2171*
2172 CALL pb_infog2l( ix, jx, descx, nprow, npcol, myrow, mycol,
2173 $ iix, jjx, ixrow, ixcol )
2174 rowrep = ( ixrow.EQ.-1 )
2175 colrep = ( ixcol.EQ.-1 )
2176*
2177 IF( descx( m_ ).EQ.1 .AND. n.EQ.1 ) THEN
2178*
2179* This is the special case, find process owner of IX, JX, and
2180* only this process is the scope.
2181*
2182 pisinscope = ( ( ixrow.EQ.myrow .OR. rowrep ) .AND.
2183 $ ( ixcol.EQ.mycol .OR. colrep ) )
2184*
2185 ELSE
2186*
2187 IF( incx.EQ.descx( m_ ) ) THEN
2188*
2189* row vector
2190*
2191 pisinscope = ( myrow.EQ.ixrow .OR. rowrep )
2192*
2193 ELSE
2194*
2195* column vector
2196*
2197 pisinscope = ( mycol.EQ.ixcol .OR. colrep )
2198*
2199 END IF
2200*
2201 END IF
2202*
2203 RETURN
2204*
2205* End of PISINSCOPE
2206*
subroutine pb_infog2l(i, j, desc, nprow, npcol, myrow, mycol, ii, jj, prow, pcol)
Definition pblastst.f:1673
logical function pisinscope(ictxt, n, ix, jx, descx, incx)
Here is the call graph for this function: