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

◆ PB_Cplaprnt()

void PB_Cplaprnt ( PBTYP_T TYPE,
Int  M,
Int  N,
char *  A,
Int  IA,
Int  JA,
Int DESCA,
Int  IRPRNT,
Int  ICPRNT,
char *  CMATNM 
)

Definition at line 24 of file PB_Cplaprnt.c.

36{
37/*
38* Purpose
39* =======
40*
41* PB_Cplaprnt prints to the standard output the submatrix sub( A ) de-
42* noting A(IA:IA+M-1,JA:JA+N-1). The local pieces of sub( A ) are sent
43* and printed by the process of coordinates (IRPRNT, ICPRNT).
44*
45* Notes
46* =====
47*
48* A description vector is associated with each 2D block-cyclicly dis-
49* tributed matrix. This vector stores the information required to
50* establish the mapping between a matrix entry and its corresponding
51* process and memory location.
52*
53* In the following comments, the character _ should be read as
54* "of the distributed matrix". Let A be a generic term for any 2D
55* block cyclicly distributed matrix. Its description vector is DESC_A:
56*
57* NOTATION STORED IN EXPLANATION
58* ---------------- --------------- ------------------------------------
59* DTYPE_A (global) DESCA[ DTYPE_ ] The descriptor type.
60* CTXT_A (global) DESCA[ CTXT_ ] The BLACS context handle, indicating
61* the NPROW x NPCOL BLACS process grid
62* A is distributed over. The context
63* itself is global, but the handle
64* (the integer value) may vary.
65* M_A (global) DESCA[ M_ ] The number of rows in the distribu-
66* ted matrix A, M_A >= 0.
67* N_A (global) DESCA[ N_ ] The number of columns in the distri-
68* buted matrix A, N_A >= 0.
69* IMB_A (global) DESCA[ IMB_ ] The number of rows of the upper left
70* block of the matrix A, IMB_A > 0.
71* INB_A (global) DESCA[ INB_ ] The number of columns of the upper
72* left block of the matrix A,
73* INB_A > 0.
74* MB_A (global) DESCA[ MB_ ] The blocking factor used to distri-
75* bute the last M_A-IMB_A rows of A,
76* MB_A > 0.
77* NB_A (global) DESCA[ NB_ ] The blocking factor used to distri-
78* bute the last N_A-INB_A columns of
79* A, NB_A > 0.
80* RSRC_A (global) DESCA[ RSRC_ ] The process row over which the first
81* row of the matrix A is distributed,
82* NPROW > RSRC_A >= 0.
83* CSRC_A (global) DESCA[ CSRC_ ] The process column over which the
84* first column of A is distributed.
85* NPCOL > CSRC_A >= 0.
86* LLD_A (local) DESCA[ LLD_ ] The leading dimension of the local
87* array storing the local blocks of
88* the distributed matrix A,
89* IF( Lc( 1, N_A ) > 0 )
90* LLD_A >= MAX( 1, Lr( 1, M_A ) )
91* ELSE
92* LLD_A >= 1.
93*
94* Let K be the number of rows of a matrix A starting at the global in-
95* dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
96* that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
97* receive if these K rows were distributed over NPROW processes. If K
98* is the number of columns of a matrix A starting at the global index
99* JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
100* lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
101* these K columns were distributed over NPCOL processes.
102*
103* The values of Lr() and Lc() may be determined via a call to the func-
104* tion PB_Cnumroc:
105* Lr( IA, K ) = PB_Cnumroc( K, IA, IMB_A, MB_A, MYROW, RSRC_A, NPROW )
106* Lc( JA, K ) = PB_Cnumroc( K, JA, INB_A, NB_A, MYCOL, CSRC_A, NPCOL )
107*
108* Arguments
109* =========
110*
111* TYPE (local input) pointer to a PBTYP_T structure
112* On entry, TYPE is a pointer to a structure of type PBTYP_T,
113* that contains type information (See pblas.h).
114*
115* M (global input) INTEGER
116* On entry, M specifies the number of rows of the submatrix
117* sub( A ). M must be at least zero.
118*
119* N (global input) INTEGER
120* On entry, N specifies the number of columns of the submatrix
121* sub( A ). N must be at least zero.
122*
123* A (local input) pointer to CHAR
124* On entry, A is an array of dimension (LLD_A, Ka), where Ka is
125* at least Lc( 1, JA+N-1 ). Before entry, this array contains
126* the local entries of the matrix A.
127*
128* IA (global input) INTEGER
129* On entry, IA specifies A's global row index, which points to
130* the beginning of the submatrix sub( A ).
131*
132* JA (global input) INTEGER
133* On entry, JA specifies A's global column index, which points
134* to the beginning of the submatrix sub( A ).
135*
136* DESCA (global and local input) INTEGER array
137* On entry, DESCA is an integer array of dimension DLEN_. This
138* is the array descriptor for the matrix A.
139*
140* IRPRNT (global input) INTEGER
141* On entry, IRPRNT specifies the row index of the printing pro-
142* cess.
143*
144* ICPRNT (global input) INTEGER
145* On entry, ICPRNT specifies the column index of the printing
146* process.
147*
148* CMATNM (global input) pointer to CHAR
149* On entry, CMATNM is the name of the matrix to be printed.
150*
151* -- Written on April 1, 1998 by
152* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
153*
154* ---------------------------------------------------------------------
155*/
156/*
157* .. Local Scalars ..
158*/
159 Int mycol, myrow, npcol, nprow, pcol, prow;
160/* ..
161* .. Executable Statements ..
162*
163*/
164/*
165* Retrieve process grid information
166*/
167 Cblacs_gridinfo( DESCA[CTXT_], &nprow, &npcol, &myrow, &mycol );
168/*
169* When sub( A ) is replicated, each copy is printed for debugging purposes.
170*/
171 if( DESCA[ RSRC_ ] >= 0 )
172 {
173/*
174* sub( A ) is distributed onto the process rows of the grid
175*/
176 if( DESCA[ CSRC_ ] >= 0 )
177 {
178/*
179* sub( A ) is distributed onto the process columns of the grid
180*/
181 PB_Cplaprn2( TYPE, M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT, CMATNM,
182 DESCA[ RSRC_ ], DESCA[ CSRC_ ] );
183 }
184 else
185 {
186/*
187* sub( A ) is replicated in every process column of the grid
188*/
189 for( pcol = 0; pcol < npcol; pcol++ )
190 {
191 if( ( myrow == IRPRNT ) && ( mycol == ICPRNT ) )
192 (void) fprintf( stdout,
193 "Colum-replicated array -- copy in process column: %d\n", pcol );
194 PB_Cplaprn2( TYPE, M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT, CMATNM,
195 DESCA[ RSRC_ ], pcol );
196 }
197 }
198 }
199 else
200 {
201/*
202* sub( A ) is replicated in every process row of the grid
203*/
204 if( DESCA[ CSRC_ ] >= 0 )
205 {
206/*
207* sub( A ) is distributed onto the process columns of the grid
208*/
209 for( prow = 0; prow < nprow; prow++ )
210 {
211 if( ( myrow == IRPRNT ) && ( mycol == ICPRNT ) )
212 (void) fprintf( stdout,
213 "Row-replicated array -- copy in process row: %d\n", prow );
214 PB_Cplaprn2( TYPE, M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT, CMATNM,
215 prow, DESCA[ CSRC_ ] );
216 }
217 }
218 else
219 {
220/*
221* sub( A ) is replicated in every process column of the grid
222*/
223 for( prow = 0; prow < nprow; prow++ )
224 {
225 for( pcol = 0; pcol < npcol; pcol++ )
226 {
227 if( ( myrow == IRPRNT ) && ( mycol == ICPRNT ) )
228 (void) fprintf( stdout,
229 "Replicated array -- copy in process (%d,%d)\n", prow, pcol );
230 PB_Cplaprn2( TYPE, M, N, A, IA, JA, DESCA, IRPRNT, ICPRNT,
231 CMATNM, prow, pcol );
232 }
233 }
234 }
235 }
236/*
237* End of PB_Cplaprnt
238*/
239}
#define Int
Definition Bconfig.h:22
void Cblacs_gridinfo()
#define CTXT_
Definition PBtools.h:38
#define RSRC_
Definition PBtools.h:45
void PB_Cplaprn2()
#define CSRC_
Definition PBtools.h:46
#define TYPE
Definition clamov.c:7
Here is the call graph for this function: