ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/utils/simError.cpp
(Generate patch)

Comparing:
branches/development/src/utils/simError.cpp (file contents), Revision 1668 by gezelter, Fri Jan 6 19:03:05 2012 UTC vs.
trunk/src/utils/simError.cpp (file contents), Revision 1969 by gezelter, Wed Feb 26 14:14:50 2014 UTC

# Line 35 | Line 35
35   *                                                                      
36   * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37   * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 < * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
38 > * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
39   * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40   * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42 + #ifdef  IS_MPI
43 + #include <mpi.h>
44 + #endif
45  
46   #include <stdlib.h>
47   #include <stdio.h>
48   #include <string.h>
49   #include "config.h"
47 #ifdef  IS_MPI
48 #include <mpi.h>
49 #endif
50  
51   int nChecks;
52  
# Line 64 | Line 64 | void initSimError( void ){
64    painCave.isEventLoop = 0;
65    nChecks = 0;
66   #ifdef IS_MPI
67 <  MPI_Comm_rank( MPI_COMM_WORLD, &worldRank );
67 >  MPI_Comm_rank( MPI_COMM_WORLD, &worldRank);
68   #else
69    worldRank = 0;
70   #endif
# Line 72 | Line 72 | int simError( void ) {
72  
73   int simError( void ) {
74    
75 +  char errorMsg[MAX_SIM_ERROR_MSG_LENGTH];
76 +
77 + #ifdef IS_MPI
78    int myError = 1;
79    int isError;
77  char errorMsg[MAX_SIM_ERROR_MSG_LENGTH];
80    char nodeMsg[MAX_SIM_ERROR_MSG_LENGTH];
81 + #endif
82    
83    strcpy(errorMsg, "OpenMD ");
84    switch( painCave.severity ) {
# Line 115 | Line 118 | int simError( void ) {
118  
119    if (painCave.isFatal) {
120   #ifdef IS_MPI    
121 <    MPI_Allreduce( &myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD );
121 >    MPI_Allreduce(&myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
122      MPI_Finalize();
123   #endif
124      exit(0);
125 <  }
123 <
125 >  }  
126    return 1;  
127   }
126
128  
129 +
130   void errorCheckPoint( void ){
131 <    
131 >  
132    int myError = 0;
133    int isError = 0;
134 <
134 >  
135   #ifdef IS_MPI
136 <  MPI_Allreduce( &myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD );
136 >  MPI_Allreduce(&myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
137   #else
138    isError = myError;
139   #endif
140 <
141 <  if( isError ){
140 <
140 >  
141 >  if( isError ){    
142   #ifdef IS_MPI
143      MPI_Finalize();
144 < #endif
144 <
144 > #endif    
145      exit(0);
146    }
147 <
147 >  
148   #ifdef CHECKPOINT_VERBOSE  
149    nChecks++;
150  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines