File: pberror_.c

package info (click to toggle)
scalapack 1.6-13
  • links: PTS
  • area: main
  • in suites: potato
  • size: 30,476 kB
  • ctags: 25,789
  • sloc: fortran: 296,718; ansic: 51,265; makefile: 1,541; sh: 4
file content (80 lines) | stat: -rw-r--r-- 1,967 bytes parent folder | download
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* ---------------------------------------------------------------------
*
*  -- ScaLAPACK routine (version 1.0) --
*     University of Tennessee, Knoxville, Oak Ridge National Laboratory,
*     and University of California, Berkeley.
*     November 17, 1996
*
*  ---------------------------------------------------------------------
*/
/*
*  Include files
*/
#include "pblas.h"

void pberror_( ctxt, mess, info )
/*
*  .. Scalar Arguments ..
*/
   int         * ctxt, * info;
/* ..
*  .. Array Arguments ..
*/
   char        * mess;
{
/*
*  Purpose
*  =======
*
*  pberror_ is an error handler of the PBLAS routines, displays an error
*  message on stderr, and stops the running program.
*
* ======================================================================
*
*  .. Parameters ..
*/
#define DESCMULT      100
#define BIGNUM      10000
/* ..
*  .. Local Scalars ..
*/
   int         iinfo, mycol, myrow, npcol, nprow;
/* ..
*  .. External Functions ..
*/
   void        blacs_abort_();
   void        blacs_gridinfo_();
/* ..
*  .. Executable Statements ..
*/
   blacs_gridinfo_( ctxt, &nprow, &npcol, &myrow, &mycol );

   iinfo = *info;
   if( iinfo < 0 )
   {
      iinfo = -iinfo;
      if( iinfo < DESCMULT )
      {
         fprintf( stderr, "{%5d,%5d}: On entry to %s ", myrow, mycol,
                  mess );
         fprintf( stderr, "parameter number %2d had an illegal value\n",
                  iinfo );
      }
      else
      {
         fprintf( stderr, "{%5d,%5d}: On entry to %s ", myrow, mycol,
                  mess );
         fprintf( stderr, "parameter number %2d had an illegal value\n",
                  iinfo / DESCMULT );
         fprintf( stderr, "entry # %2d had an illegal value\n",
                  iinfo % DESCMULT );
      }
   }
   else
   {
      fprintf( stderr,
               "{%5d,%5d}: Positive error code %2d returned by %s !!!\n", 
               myrow, mycol, iinfo, mess );
   }
   blacs_abort_( ctxt, &iinfo );
}