File: BI_BlacsErr.c

package info (click to toggle)
blacs-mpi 1.1-28.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,320 kB
  • ctags: 2,031
  • sloc: fortran: 14,968; ansic: 12,353; makefile: 531; sh: 1
file content (49 lines) | stat: -rw-r--r-- 992 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "Bdef.h"

#ifdef __STDC__
void BI_BlacsErr(int ConTxt, int line, char *file, char *form, ...)
#else
void BI_BlacsErr(va_alist)
va_dcl
#endif
{
#ifdef __STDC__
   void BI_BlacsAbort(int ErrNo);
#else
   void BI_BlacsAbort();
#endif
   extern int BI_Iam;
   int myrow, mycol;
   va_list argptr;
   char cline[100];
   BLACSCONTEXT *ctxt;

#ifdef __STDC__
   va_start(argptr, form);
#else
   char *file, *form;
   int ConTxt, line;

   va_start(argptr);
   ConTxt = va_arg(argptr, int);
   line = va_arg(argptr, int);
   file = va_arg(argptr, char *);
   form = va_arg(argptr, char *);
#endif
   vsprintf(cline, form, argptr);
   va_end(argptr);

   if (ConTxt > -1)
   {
      MGetConTxt(ConTxt, ctxt);
      myrow = ctxt->cscp.Iam;
      mycol = ctxt->rscp.Iam;
   }
   else myrow = mycol = -1;

   fprintf(stderr,
"BLACS ERROR '%s'\nfrom {%d,%d}, pnum=%d, Contxt=%d, on line %d of file '%s'.\n\n",
           cline, myrow, mycol, BI_Iam, ConTxt, line, file);

   BI_BlacsAbort(1);
}