ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/interface_implementation/simError.c
(Generate patch)

Comparing trunk/mdtools/interface_implementation/simError.c (file contents):
Revision 156 by mmeineke, Thu Oct 24 20:40:52 2002 UTC vs.
Revision 164 by mmeineke, Tue Nov 5 22:04:46 2002 UTC

# Line 3 | Line 3
3  
4   #ifdef  IS_MPI
5   #include <mpi.h>
6 +
7 + int nChecks;
8   #endif // IS_MPI
9  
10   #include "simError.h"
# Line 13 | Line 15 | void initSimError( void ){
15    painCave.isFatal = 0;
16   #ifdef IS_MPI
17    painCave.isEventLoop = 0;
18 +  nChecks = 0;
19 +  MPI_Comm_rank( MPI_COMM_WORLD, &WorldRank );
20   #endif
21   }
22  
23   int simError( void ) {
24    
25   #ifdef IS_MPI
22  int myRank;
26    int myError = 1;
27    int isError;
28    int isFatal;
29  
30 <  MPI_Comm_rank( MPI_COMM_WORLD, &myRank );
28 <
29 <  if( painCave.isEventLoop ){
30 >   if( painCave.isEventLoop ){
31      fprintf( stderr,
32 <             "MPI Error on node %d: %s\n",
33 <             myRank,
32 >             "MPI Event Error on node %d: %s\n",
33 >             worldRank,
34               painCave.errMsg );
35      return 1;
36    }
# Line 37 | Line 38 | int simError( void ) {
38      if( painCave.isFatal ){
39        fprintf( stderr,
40                 "MPI Fatal Error on node %d: %s\n",
41 <               myRank,
41 >               worldRank,
42                 painCave.errMsg );
43        MPI_Allreduce( &myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD );
44        
# Line 47 | Line 48 | int simError( void ) {
48      else{
49        fprintf( stderr,
50                 "MPI Non-Fatal Error on node %d: %s\n",
51 <               myRank,
51 >               worldRank,
52                 painCave.errMsg );
53      }
54      return 1;
# Line 77 | Line 78 | void checkMPIError( void ){
78    
79   #ifdef IS_MPI
80  
81 < void checkMPIError( void ){
81 > void MPIcheckPoint( void ){
82    
83    int myError = 0;
84    int isError;
# Line 87 | Line 88 | void checkMPIError( void ){
88      MPI_Finalize();
89      exit(0);
90    }
91 +
92 + #ifdef CHECKPOINT_VERBOSE  
93 +  nChecks++;
94 +  if( worldRank == 0 ){
95 +    fprintf(stderr,
96 +            "Checkpoint #%d reached: %s\n",
97 +            nChecks,
98 +            checkPointMsg );
99 +  }
100 + #endif // CHECKPOINT_VERBOSE  
101 +
102   }
103  
104   #endif // IS_MPI

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines