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

◆ PB_Cwarn()

void PB_Cwarn ( va_alist  )

Definition at line 63 of file PB_Cwarn.c.

66{
67/*
68* Purpose
69* =======
70*
71* PB_Cwarn is an error handler for the PBLAS routines. This routine
72* displays an error message on stderr.
73*
74* Arguments
75* =========
76*
77* ICTXT (local input) INTEGER
78* On entry, ICTXT specifies the BLACS context handle, indica-
79* ting the global context of the operation. The context itself
80* is global, but the value of ICTXT is local.
81*
82* LINE (local input) INTEGER
83* On entry, LINE specifies the line number in the file where
84* the error has occured. When LINE is not a valid line number,
85*
86* ROUT (global input) pointer to CHAR
87* On entry, ROUT specifies the name of the routine calling this
88* error handler.
89*
90* FORM (local input) pointer to CHAR
91* On entry, FORM is a control string specifying the format
92* conversion of its following arguments.
93*
94* ... (local input)
95* On entry, FORM is a control string specifying the format
96* On entry, the expressions that are to be evaluated and con-
97* verted according to the formats in the control string FORM
98* and then placed in the output stream.
99*
100* -- Written on April 1, 1998 by
101* R. Clint Whaley, University of Tennessee, Knoxville 37996, USA.
102*
103* ---------------------------------------------------------------------
104*/
105 va_list argptr;
106 Int iam, mycol, myrow, npcol, nprow;
107 char cline[100];
108/* ..
109* .. External Functions ..
110*/
111#ifdef TestingPblas
112#ifdef __STDC__
113 Int PB_NoAbort( Int * );
114#else
115 Int PB_NoAbort();
116#endif
117#endif
118
119#ifdef __STDC__
120 va_start( argptr, FORM );
121#else
122 char * ROUT, * FORM;
123 Int ICTXT, LINE;
124/* ..
125* .. Executable Statements ..
126*
127*/
128 va_start( argptr );
129 ICTXT = va_arg( argptr, Int );
130 LINE = va_arg( argptr, Int );
131 ROUT = va_arg( argptr, char * );
132 FORM = va_arg( argptr, char * );
133#endif
134
135#ifdef TestingPblas
136/*
137* For testing purpose only, the error is reported, but the program execution
138* is not terminated
139*/
140 if( PB_NoAbort( &ICTXT ) ) return;
141#endif
142 vsprintf( cline, FORM, argptr );
143 va_end( argptr );
144
145 Cblacs_gridinfo( ICTXT, &nprow, &npcol, &myrow, &mycol );
146
147 if( nprow != -1 ) iam = Cblacs_pnum( ICTXT, myrow, mycol );
148 else iam = -1;
149/*
150* Display an error message
151*/
152 if( LINE <= 0 )
153 (void) fprintf( stderr, "%s'%s'\n%s{%d,%d}, %s%d, %s%d%s'%s'.\n\n",
154 "PBLAS ERROR ", cline, "from ", myrow, mycol, "pnum=",
155 iam, "Contxt=", ICTXT, ", in routine ", ROUT );
156 else
157 (void) fprintf( stderr, "%s'%s'\n%s{%d,%d}, %s%d, %s%d%s%d%s'%s'.\n\n",
158 "PBLAS ERROR ", cline, "from ", myrow, mycol, "pnum=",
159 iam, "Contxt=", ICTXT, ", on line ", LINE,
160 " of routine ", ROUT );
161/*
162* End of PB_Cwarn
163*/
164}
#define Int
Definition Bconfig.h:22
#define PB_NoAbort
Definition PB_Cwarn.c:48
Int Cblacs_pnum()
void Cblacs_gridinfo()
Here is the call graph for this function: