ScaLAPACK 2.1  2.1
ScaLAPACK: Scalable Linear Algebra PACKage
pcsymm_.c
Go to the documentation of this file.
1 /* ---------------------------------------------------------------------
2 *
3 * -- PBLAS routine (version 2.0) --
4 * University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5 * and University of California, Berkeley.
6 * April 1, 1998
7 *
8 * ---------------------------------------------------------------------
9 */
10 /*
11 * Include files
12 */
13 #include "pblas.h"
14 #include "PBpblas.h"
15 #include "PBtools.h"
16 #include "PBblacs.h"
17 #include "PBblas.h"
18 
19 #ifdef __STDC__
20 void pcsymm_( F_CHAR_T SIDE, F_CHAR_T UPLO, int * M, int * N,
21  float * ALPHA,
22  float * A, int * IA, int * JA, int * DESCA,
23  float * B, int * IB, int * JB, int * DESCB,
24  float * BETA,
25  float * C, int * IC, int * JC, int * DESCC )
26 #else
27 void pcsymm_( SIDE, UPLO, M, N, ALPHA, A, IA, JA, DESCA,
28  B, IB, JB, DESCB, BETA, C, IC, JC, DESCC )
29 /*
30 * .. Scalar Arguments ..
31 */
32  F_CHAR_T SIDE, UPLO;
33  int * IA, * IB, * IC, * JA, * JB, * JC, * M, * N;
34  float * ALPHA, * BETA;
35 /*
36 * .. Array Arguments ..
37 */
38  int * DESCA, * DESCB, * DESCC;
39  float * A, * B, * C;
40 #endif
41 {
42 /*
43 * Purpose
44 * =======
45 *
46 * PCSYMM performs one of the matrix-matrix operations
47 *
48 * sub( C ) := alpha*sub( A )*sub( B ) + beta*sub( C ),
49 *
50 * or
51 *
52 * sub( C ) := alpha*sub( B )*sub( A ) + beta*sub( C ),
53 *
54 * where
55 *
56 * sub( C ) denotes C(IC:IC+M-1,JC:JC+N-1),
57 *
58 * sub( A ) denotes A(IA:IA+M-1,JA:JA+M-1) if SIDE = 'L',
59 * A(IA:IA+N-1,JA:JA+N-1) if SIDE = 'R', and,
60 *
61 * sub( B ) denotes B(IB:IB+M-1,JB:JB+N-1).
62 *
63 * Alpha and beta are scalars, sub( A ) is a symmetric submatrix and
64 * sub( B ) and sub( C ) are m by n submatrices.
65 *
66 * Notes
67 * =====
68 *
69 * A description vector is associated with each 2D block-cyclicly dis-
70 * tributed matrix. This vector stores the information required to
71 * establish the mapping between a matrix entry and its corresponding
72 * process and memory location.
73 *
74 * In the following comments, the character _ should be read as
75 * "of the distributed matrix". Let A be a generic term for any 2D
76 * block cyclicly distributed matrix. Its description vector is DESC_A:
77 *
78 * NOTATION STORED IN EXPLANATION
79 * ---------------- --------------- ------------------------------------
80 * DTYPE_A (global) DESCA[ DTYPE_ ] The descriptor type.
81 * CTXT_A (global) DESCA[ CTXT_ ] The BLACS context handle, indicating
82 * the NPROW x NPCOL BLACS process grid
83 * A is distributed over. The context
84 * itself is global, but the handle
85 * (the integer value) may vary.
86 * M_A (global) DESCA[ M_ ] The number of rows in the distribu-
87 * ted matrix A, M_A >= 0.
88 * N_A (global) DESCA[ N_ ] The number of columns in the distri-
89 * buted matrix A, N_A >= 0.
90 * IMB_A (global) DESCA[ IMB_ ] The number of rows of the upper left
91 * block of the matrix A, IMB_A > 0.
92 * INB_A (global) DESCA[ INB_ ] The number of columns of the upper
93 * left block of the matrix A,
94 * INB_A > 0.
95 * MB_A (global) DESCA[ MB_ ] The blocking factor used to distri-
96 * bute the last M_A-IMB_A rows of A,
97 * MB_A > 0.
98 * NB_A (global) DESCA[ NB_ ] The blocking factor used to distri-
99 * bute the last N_A-INB_A columns of
100 * A, NB_A > 0.
101 * RSRC_A (global) DESCA[ RSRC_ ] The process row over which the first
102 * row of the matrix A is distributed,
103 * NPROW > RSRC_A >= 0.
104 * CSRC_A (global) DESCA[ CSRC_ ] The process column over which the
105 * first column of A is distributed.
106 * NPCOL > CSRC_A >= 0.
107 * LLD_A (local) DESCA[ LLD_ ] The leading dimension of the local
108 * array storing the local blocks of
109 * the distributed matrix A,
110 * IF( Lc( 1, N_A ) > 0 )
111 * LLD_A >= MAX( 1, Lr( 1, M_A ) )
112 * ELSE
113 * LLD_A >= 1.
114 *
115 * Let K be the number of rows of a matrix A starting at the global in-
116 * dex IA,i.e, A( IA:IA+K-1, : ). Lr( IA, K ) denotes the number of rows
117 * that the process of row coordinate MYROW ( 0 <= MYROW < NPROW ) would
118 * receive if these K rows were distributed over NPROW processes. If K
119 * is the number of columns of a matrix A starting at the global index
120 * JA, i.e, A( :, JA:JA+K-1, : ), Lc( JA, K ) denotes the number of co-
121 * lumns that the process MYCOL ( 0 <= MYCOL < NPCOL ) would receive if
122 * these K columns were distributed over NPCOL processes.
123 *
124 * The values of Lr() and Lc() may be determined via a call to the func-
125 * tion PB_Cnumroc:
126 * Lr( IA, K ) = PB_Cnumroc( K, IA, IMB_A, MB_A, MYROW, RSRC_A, NPROW )
127 * Lc( JA, K ) = PB_Cnumroc( K, JA, INB_A, NB_A, MYCOL, CSRC_A, NPCOL )
128 *
129 * Arguments
130 * =========
131 *
132 * SIDE (global input) CHARACTER*1
133 * On entry, SIDE specifies whether the symmetric submatrix
134 * sub( A ) appears on the left or right in the operation as
135 * follows:
136 *
137 * SIDE = 'L' or 'l'
138 * sub( C ) := alpha*sub( A )*sub( B ) + beta*sub( C ),
139 *
140 * SIDE = 'R' or 'r'
141 * sub( C ) := alpha*sub( B )*sub( A ) + beta*sub( C ).
142 *
143 * UPLO (global input) CHARACTER*1
144 * On entry, UPLO specifies whether the local pieces of
145 * the array A containing the upper or lower triangular part
146 * of the symmetric submatrix sub( A ) are to be referenced as
147 * follows:
148 *
149 * UPLO = 'U' or 'u' Only the local pieces corresponding to
150 * the upper triangular part of the
151 * symmetric submatrix sub( A ) are to be
152 * referenced,
153 *
154 * UPLO = 'L' or 'l' Only the local pieces corresponding to
155 * the lower triangular part of the
156 * symmetric submatrix sub( A ) are to be
157 * referenced.
158 *
159 * M (global input) INTEGER
160 * On entry, M specifies the number of rows of the submatrix
161 * sub( C ). M must be at least zero.
162 *
163 * N (global input) INTEGER
164 * On entry, N specifies the number of columns of the submatrix
165 * sub( C ). N must be at least zero.
166 *
167 * ALPHA (global input) COMPLEX
168 * On entry, ALPHA specifies the scalar alpha. When ALPHA is
169 * supplied as zero then the local entries of the arrays A and
170 * B corresponding to the entries of the submatrices sub( A )
171 * and sub( B ) respectively need not be set on input.
172 *
173 * A (local input) COMPLEX array
174 * On entry, A is an array of dimension (LLD_A, Ka), where Ka is
175 * at least Lc( 1, JA+M-1 ) when SIDE = 'L' or 'l' and is at
176 * at least Lc( 1, JA+N-1 ) otherwise. Before entry, this array
177 * contains the local entries of the matrix A.
178 * Before entry with SIDE = 'L' or 'l', this array contains
179 * the local entries corresponding to the entries of the m by m
180 * symmetric submatrix sub( A ), such that when UPLO = 'U' or
181 * 'u', this array contains the local entries of the upper tri-
182 * angular part of the symmetric submatrix sub( A ), and the
183 * local entries of the strictly lower triangular of sub( A )
184 * are not referenced, and when UPLO = 'L' or 'l', this array
185 * contains the local entries of the lower triangular part of
186 * the symmetric submatrix sub( A ), and the local entries of
187 * the strictly upper triangular of sub( A ) are not referenced.
188 * Before entry with SIDE = 'R' or 'r', this array contains
189 * the local entries corresponding to the entries of the n by n
190 * symmetric submatrix sub( A ), such that when UPLO = 'U' or
191 * 'u', this array contains the local entries of the upper tri-
192 * angular part of the symmetric submatrix sub( A ), and the
193 * local entries of the strictly lower triangular of sub( A )
194 * are not referenced, and when UPLO = 'L' or 'l', this array
195 * contains the local entries of the lower triangular part of
196 * the symmetric submatrix sub( A ), and the local entries of
197 * the strictly upper triangular of sub( A ) are not referenced.
198 *
199 * IA (global input) INTEGER
200 * On entry, IA specifies A's global row index, which points to
201 * the beginning of the submatrix sub( A ).
202 *
203 * JA (global input) INTEGER
204 * On entry, JA specifies A's global column index, which points
205 * to the beginning of the submatrix sub( A ).
206 *
207 * DESCA (global and local input) INTEGER array
208 * On entry, DESCA is an integer array of dimension DLEN_. This
209 * is the array descriptor for the matrix A.
210 *
211 * B (local input) COMPLEX array
212 * On entry, B is an array of dimension (LLD_B, Kb), where Kb is
213 * at least Lc( 1, JB+N-1 ). Before entry, this array contains
214 * the local entries of the matrix B.
215 *
216 * IB (global input) INTEGER
217 * On entry, IB specifies B's global row index, which points to
218 * the beginning of the submatrix sub( B ).
219 *
220 * JB (global input) INTEGER
221 * On entry, JB specifies B's global column index, which points
222 * to the beginning of the submatrix sub( B ).
223 *
224 * DESCB (global and local input) INTEGER array
225 * On entry, DESCB is an integer array of dimension DLEN_. This
226 * is the array descriptor for the matrix B.
227 *
228 * BETA (global input) COMPLEX
229 * On entry, BETA specifies the scalar beta. When BETA is
230 * supplied as zero then the local entries of the array C
231 * corresponding to the entries of the submatrix sub( C ) need
232 * not be set on input.
233 *
234 * C (local input/local output) COMPLEX array
235 * On entry, C is an array of dimension (LLD_C, Kc), where Kc is
236 * at least Lc( 1, JC+N-1 ). Before entry, this array contains
237 * the local entries of the matrix C.
238 * On exit, the entries of this array corresponding to the local
239 * entries of the submatrix sub( C ) are overwritten by the
240 * local entries of the m by n updated submatrix.
241 *
242 * IC (global input) INTEGER
243 * On entry, IC specifies C's global row index, which points to
244 * the beginning of the submatrix sub( C ).
245 *
246 * JC (global input) INTEGER
247 * On entry, JC specifies C's global column index, which points
248 * to the beginning of the submatrix sub( C ).
249 *
250 * DESCC (global and local input) INTEGER array
251 * On entry, DESCC is an integer array of dimension DLEN_. This
252 * is the array descriptor for the matrix C.
253 *
254 * -- Written on April 1, 1998 by
255 * Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
256 *
257 * ---------------------------------------------------------------------
258 */
259 /*
260 * .. Local Scalars ..
261 */
262  char DirAB, SideOp, UploA, cbtop, cbtopsave, cctop, cctopsave,
263  rbtop, rbtopsave, rctop, rctopsave;
264  int Ai, Aj, Bi, Bj, ChooseABC, Ci, Cj, ForceTop, ctxt, info,
265  lside, mycol, myrow, nb, npcol, nprow, upper;
266  double ABCest, BCest, tmp1, tmp2, tmp3, tmp4;
267  PBTYP_T * type;
268 /*
269 * .. Local Arrays ..
270 */
271  int Ad[DLEN_], Bd[DLEN_], Cd[DLEN_];
272 /* ..
273 * .. Executable Statements ..
274 *
275 */
276  lside = ( ( SideOp = Mupcase( F2C_CHAR( SIDE )[0] ) ) == CLEFT );
277  upper = ( ( UploA = Mupcase( F2C_CHAR( UPLO )[0] ) ) == CUPPER );
278  PB_CargFtoC( *IA, *JA, DESCA, &Ai, &Aj, Ad );
279  PB_CargFtoC( *IB, *JB, DESCB, &Bi, &Bj, Bd );
280  PB_CargFtoC( *IC, *JC, DESCC, &Ci, &Cj, Cd );
281 #ifndef NO_ARGCHK
282 /*
283 * Test the input parameters
284 */
285  Cblacs_gridinfo( ( ctxt = Ad[CTXT_] ), &nprow, &npcol, &myrow, &mycol );
286  if( !( info = ( ( nprow == -1 ) ? -( 901 + CTXT_ ) : 0 ) ) )
287  {
288  if( ( !lside ) && ( SideOp != CRIGHT ) )
289  {
290  PB_Cwarn( ctxt, __LINE__, "PCSYMM", "Illegal SIDE = %c\n", SideOp );
291  info = -1;
292  }
293  else if( ( !upper ) && ( UploA != CLOWER ) )
294  {
295  PB_Cwarn( ctxt, __LINE__, "PCSYMM", "Illegal UPLO = %c\n", UploA );
296  info = -2;
297  }
298  if( lside )
299  {
300  PB_Cchkmat( ctxt, "PCSYMM", "A", *M, 3, *M, 3, Ai, Aj, Ad, 9,
301  &info );
302  PB_Cchkmat( ctxt, "PCSYMM", "B", *M, 3, *N, 4, Bi, Bj, Bd, 13,
303  &info );
304  }
305  else
306  {
307  PB_Cchkmat( ctxt, "PCSYMM", "A", *N, 4, *N, 4, Ai, Aj, Ad, 9,
308  &info );
309  PB_Cchkmat( ctxt, "PCSYMM", "B", *M, 3, *N, 4, Bi, Bj, Bd, 13,
310  &info );
311  }
312  PB_Cchkmat( ctxt, "PCSYMM", "C", *M, 3, *N, 4, Ci, Cj, Cd, 18,
313  &info );
314  }
315  if( info ) { PB_Cabort( ctxt, "PCSYMM", info ); return; }
316 #endif
317 /*
318 * Quick return if possible
319 */
320  if( ( *M == 0 ) || ( *N == 0 ) ||
321  ( ( ( ALPHA[REAL_PART] == ZERO ) && ( ALPHA[IMAG_PART] == ZERO ) ) &&
322  ( ( BETA [REAL_PART] == ONE ) && ( BETA [IMAG_PART] == ZERO ) ) ) )
323  return;
324 /*
325 * Get type structure
326 */
327  type = PB_Cctypeset();
328 /*
329 * If alpha is zero, sub( C ) := beta * sub( C ).
330 */
331  if( ( ALPHA[REAL_PART] == ZERO ) && ( ALPHA[IMAG_PART] == ZERO ) )
332  {
333  if( ( BETA[REAL_PART] == ZERO ) && ( BETA[IMAG_PART] == ZERO ) )
334  {
335  PB_Cplapad( type, ALL, NOCONJG, *M, *N, type->zero, type->zero,
336  ((char *) C), Ci, Cj, Cd );
337  }
338  else if( !( ( BETA[REAL_PART] == ONE ) && ( BETA[IMAG_PART] == ZERO ) ) )
339  {
340  PB_Cplascal( type, ALL, NOCONJG, *M, *N, ((char *) BETA), ((char *) C),
341  Ci, Cj, Cd );
342  }
343  return;
344  }
345 /*
346 * Start the operations
347 */
348 #ifdef NO_ARGCHK
349  Cblacs_gridinfo( ( ctxt = Ad[CTXT_] ), &nprow, &npcol, &myrow, &mycol );
350 #endif
351 /*
352 * Algorithm selection is based on approximation of the communication volume
353 * for distributed and aligned operands.
354 *
355 * ABCest: operands sub( A ), sub( B ) and sub( C ) are communicated (N >> M)
356 * BCest : Both operands sub( B ) and sub( C ) are communicated (M >> N)
357 */
358  if( lside )
359  {
360  tmp1 = DNROC( *M, Ad[MB_], nprow ); tmp2 = DNROC( *N, Bd[NB_], npcol );
361  ABCest = (double)(*M) *
362  ( ( ( ( Ad[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO : tmp1 / TWO ) +
363  ( ( ( Bd[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO :
364  tmp2 + tmp2 * CBRATIO ) );
365  tmp1 = DNROC( *M, Ad[MB_], nprow ); tmp2 = DNROC( *M, Ad[NB_], npcol );
366  tmp3 = DNROC( *M, Bd[MB_], nprow ); tmp4 = DNROC( *M, Cd[MB_], nprow );
367  BCest = (double)(*N) *
368  ( CBRATIO * ( npcol == 1 ? ZERO : tmp1 ) +
369  ( nprow == 1 ? ZERO : tmp2 ) + MAX( tmp2, tmp3 ) +
370  ( ( ( Bd[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO : tmp1 ) +
371  CBRATIO * ( nprow == 1 ? ZERO : tmp2 ) + MAX( tmp2, tmp4 ) );
372  }
373  else
374  {
375  tmp1 = DNROC( *N, Ad[NB_], npcol ); tmp2 = DNROC( *M, Bd[MB_], nprow );
376  ABCest = (double)(*N) *
377  ( ( ( ( Ad[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO : tmp1 / TWO ) +
378  ( ( ( Bd[CSRC_] == -1 ) || ( npcol == 1 ) ) ? ZERO :
379  tmp2 + tmp2 * CBRATIO ) );
380  tmp1 = DNROC( *N, Ad[MB_], nprow ); tmp2 = DNROC( *N, Ad[NB_], npcol );
381  tmp3 = DNROC( *N, Bd[NB_], npcol ); tmp4 = DNROC( *N, Cd[NB_], npcol );
382  BCest = (double)(*M) *
383  ( ( npcol == 1 ? ZERO : tmp1 ) + MAX( tmp1, tmp3 ) +
384  CBRATIO * ( nprow == 1 ? ZERO : tmp2 ) +
385  ( ( ( Bd[RSRC_] == -1 ) || ( nprow == 1 ) ) ? ZERO : tmp2 ) +
386  CBRATIO * ( npcol == 1 ? ZERO : tmp1 ) + MAX( tmp1, tmp4 ) );
387  }
388 /*
389 * Shift a little the cross-over point between both algorithms.
390 */
391  ChooseABC = ( ( 1.5 * ABCest ) <= BCest );
392 /*
393 * BLACS topologies are enforced iff M and N are strictly greater than the
394 * logical block size returned by pilaenv_. Otherwise, it is assumed that the
395 * routine calling this routine has already selected an adequate topology.
396 */
397  nb = pilaenv_( &ctxt, C2F_CHAR( &type->type ) );
398  ForceTop = ( ( *M > nb ) && ( *N > nb ) );
399 
400  rbtop = *PB_Ctop( &ctxt, BCAST, ROW, TOP_GET );
401  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_GET );
402  cbtop = *PB_Ctop( &ctxt, BCAST, COLUMN, TOP_GET );
403  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_GET );
404 
405  if( ChooseABC )
406  {
407  if( ForceTop )
408  {
409  rbtopsave = rbtop; rctopsave = rctop;
410  cbtopsave = cbtop; cctopsave = cctop;
411 
412  if( lside )
413  {
414 /*
415 * No clear winner for the ring topologies, so that if a ring topology is
416 * already selected, keep it.
417 */
418  if( ( rbtop != CTOP_DRING ) && ( rbtop != CTOP_IRING ) &&
419  ( rbtop != CTOP_SRING ) )
420  rbtop = *PB_Ctop( &ctxt, BCAST, ROW, TOP_IRING );
421  if( ( ( cbtop != CTOP_DRING ) && ( cbtop != CTOP_IRING ) &&
422  ( cbtop != CTOP_SRING ) ) || ( cbtop != cctop ) )
423  {
424  cbtop = *PB_Ctop( &ctxt, BCAST, COLUMN, TOP_IRING );
425  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_IRING );
426 /*
427 * Remove the next 2 lines when the BLACS combine operations support ring
428 * topologies
429 */
430  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_DEFAULT );
431  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_DEFAULT );
432  }
433  }
434  else
435  {
436 /*
437 * No clear winner for the ring topologies, so that if a ring topology is
438 * already selected, keep it.
439 */
440  if( ( cbtop != CTOP_DRING ) && ( cbtop != CTOP_IRING ) &&
441  ( cbtop != CTOP_SRING ) )
442  cbtop = *PB_Ctop( &ctxt, BCAST, COLUMN, TOP_IRING );
443  if( ( ( rbtop != CTOP_DRING ) && ( rbtop != CTOP_IRING ) &&
444  ( rbtop != CTOP_SRING ) ) || ( rbtop != rctop ) )
445  {
446  rbtop = *PB_Ctop( &ctxt, BCAST, ROW, TOP_IRING );
447  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_IRING );
448 /*
449 * Remove the next 2 lines when the BLACS combine operations support ring
450 * topologies
451 */
452  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_DEFAULT );
453  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_DEFAULT );
454  }
455  }
456  }
457  if( lside )
458  DirAB = ( rbtop == CTOP_DRING ? CBACKWARD : CFORWARD );
459  else
460  DirAB = ( cbtop == CTOP_DRING ? CBACKWARD : CFORWARD );
461 
462  PB_CpsymmAB( type, &DirAB, NOCONJG, &SideOp, &UploA, *M, *N,
463  ((char *)ALPHA), ((char *)A), Ai, Aj, Ad, ((char *)B), Bi,
464  Bj, Bd, ((char *)BETA), ((char *)C), Ci, Cj, Cd );
465  }
466  else
467  {
468  if( ForceTop )
469  {
470  rbtopsave = rbtop; rctopsave = rctop;
471  cbtopsave = cbtop; cctopsave = cctop;
472 
473  if( lside )
474  {
475 /*
476 * No clear winner for the ring topologies, so that if a ring topology is
477 * already selected, keep it.
478 */
479  if( ( ( rbtop != CTOP_DRING ) && ( rbtop != CTOP_IRING ) &&
480  ( rbtop != CTOP_SRING ) ) || ( rbtop != rctop ) )
481  {
482  rbtop = *PB_Ctop( &ctxt, BCAST, ROW, TOP_IRING );
483  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_IRING );
484 /*
485 * Remove the next 2 lines when the BLACS combine operations support ring
486 * topologies
487 */
488  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_DEFAULT );
489  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_DEFAULT );
490  }
491  cbtop = *PB_Ctop( &ctxt, BCAST, COLUMN, TOP_DEFAULT );
492  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_DEFAULT );
493  }
494  else
495  {
496 /*
497 * No clear winner for the ring topologies, so that if a ring topology is
498 * already selected, keep it.
499 */
500  if( ( ( cbtop != CTOP_DRING ) && ( cbtop != CTOP_IRING ) &&
501  ( cbtop != CTOP_SRING ) ) || ( cbtop != cctop ) )
502  {
503  cbtop = *PB_Ctop( &ctxt, BCAST, COLUMN, TOP_IRING );
504  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_IRING );
505 /*
506 * Remove the next 2 lines when the BLACS combine operations support ring
507 * topologies
508 */
509  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_DEFAULT );
510  cctop = *PB_Ctop( &ctxt, COMBINE, COLUMN, TOP_DEFAULT );
511  }
512  rbtop = *PB_Ctop( &ctxt, BCAST, ROW, TOP_DEFAULT );
513  rctop = *PB_Ctop( &ctxt, COMBINE, ROW, TOP_DEFAULT );
514  }
515  }
516  if( lside )
517  DirAB = ( ( rbtop == CTOP_DRING || rctop == CTOP_DRING ) ?
518  CBACKWARD : CFORWARD );
519  else
520  DirAB = ( ( cbtop == CTOP_DRING || cctop == CTOP_DRING ) ?
521  CBACKWARD : CFORWARD );
522 
523  PB_CpsymmBC( type, &DirAB, NOCONJG, &SideOp, &UploA, *M, *N,
524  ((char *)ALPHA), ((char *)A), Ai, Aj, Ad, ((char *)B), Bi,
525  Bj, Bd, ((char *)BETA), ((char *)C), Ci, Cj, Cd );
526  }
527 /*
528 * Restore the BLACS topologies when necessary.
529 */
530  if( ForceTop )
531  {
532  rbtopsave = *PB_Ctop( &ctxt, BCAST, ROW, &rbtopsave );
533  rctopsave = *PB_Ctop( &ctxt, COMBINE, ROW, &rctopsave );
534  cbtopsave = *PB_Ctop( &ctxt, BCAST, COLUMN, &cbtopsave );
535  cctopsave = *PB_Ctop( &ctxt, COMBINE, COLUMN, &cctopsave );
536  }
537 /*
538 * End of PCSYMM
539 */
540 }
ROW
#define ROW
Definition: PBblacs.h:46
MB_
#define MB_
Definition: PBtools.h:43
TOP_DEFAULT
#define TOP_DEFAULT
Definition: PBblacs.h:51
PB_Cwarn
void PB_Cwarn()
PB_CpsymmAB
void PB_CpsymmAB()
NB_
#define NB_
Definition: PBtools.h:44
COLUMN
#define COLUMN
Definition: PBblacs.h:45
CSRC_
#define CSRC_
Definition: PBtools.h:46
PBblacs.h
PBtools.h
CRIGHT
#define CRIGHT
Definition: PBblas.h:30
PBblas.h
NOCONJG
#define NOCONJG
Definition: PBblas.h:45
REAL_PART
#define REAL_PART
Definition: pblas.h:135
PBTYP_T::type
char type
Definition: pblas.h:327
PBpblas.h
DLEN_
#define DLEN_
Definition: PBtools.h:48
pcsymm_
void pcsymm_(F_CHAR_T SIDE, F_CHAR_T UPLO, int *M, int *N, float *ALPHA, float *A, int *IA, int *JA, int *DESCA, float *B, int *IB, int *JB, int *DESCB, float *BETA, float *C, int *IC, int *JC, int *DESCC)
Definition: pcsymm_.c:27
CTOP_IRING
#define CTOP_IRING
Definition: PBblacs.h:27
F_CHAR_T
char * F_CHAR_T
Definition: pblas.h:118
ZERO
#define ZERO
Definition: PBtools.h:66
CTOP_DRING
#define CTOP_DRING
Definition: PBblacs.h:28
PB_CpsymmBC
void PB_CpsymmBC()
TOP_IRING
#define TOP_IRING
Definition: PBblacs.h:52
pilaenv_
int pilaenv_()
PB_Cplascal
void PB_Cplascal()
CTOP_SRING
#define CTOP_SRING
Definition: PBblacs.h:29
PB_Cabort
void PB_Cabort()
CLOWER
#define CLOWER
Definition: PBblas.h:25
PB_Cplapad
void PB_Cplapad()
F2C_CHAR
#define F2C_CHAR(a)
Definition: pblas.h:120
TOP_GET
#define TOP_GET
Definition: PBblacs.h:50
PB_Ctop
char * PB_Ctop()
ONE
#define ONE
Definition: PBtools.h:64
RSRC_
#define RSRC_
Definition: PBtools.h:45
PB_CargFtoC
void PB_CargFtoC()
BCAST
#define BCAST
Definition: PBblacs.h:48
COMBINE
#define COMBINE
Definition: PBblacs.h:49
PB_Cchkmat
void PB_Cchkmat()
CFORWARD
#define CFORWARD
Definition: PBblas.h:38
ALL
#define ALL
Definition: PBblas.h:50
C2F_CHAR
#define C2F_CHAR(a)
Definition: pblas.h:121
CBRATIO
#define CBRATIO
Definition: pblas.h:37
MAX
#define MAX(a_, b_)
Definition: PBtools.h:77
Cblacs_gridinfo
void Cblacs_gridinfo()
PBTYP_T
Definition: pblas.h:325
Mupcase
#define Mupcase(C)
Definition: PBtools.h:83
pblas.h
CUPPER
#define CUPPER
Definition: PBblas.h:26
TWO
#define TWO
Definition: PBtools.h:65
CLEFT
#define CLEFT
Definition: PBblas.h:29
CBACKWARD
#define CBACKWARD
Definition: PBblas.h:39
CTXT_
#define CTXT_
Definition: PBtools.h:38
IMAG_PART
#define IMAG_PART
Definition: pblas.h:136
PB_Cctypeset
PBTYP_T * PB_Cctypeset()
Definition: PB_Cctypeset.c:19
PBTYP_T::zero
char * zero
Definition: pblas.h:331
DNROC
#define DNROC(n_, nb_, p_)
Definition: PBtools.h:111