--- branches/development/src/utils/simError.cpp	2012/01/06 19:03:05	1668
+++ trunk/src/utils/simError.cpp	2014/02/26 14:14:50	1969
@@ -35,18 +35,18 @@
  *                                                                      
  * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).             
  * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
- * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
+ * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).          
  * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
  * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
  */
+#ifdef  IS_MPI
+#include <mpi.h>
+#endif
  
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include "config.h"
-#ifdef  IS_MPI
-#include <mpi.h>
-#endif
 
 int nChecks;
 
@@ -64,7 +64,7 @@ void initSimError( void ){
   painCave.isEventLoop = 0;
   nChecks = 0;
 #ifdef IS_MPI
-  MPI_Comm_rank( MPI_COMM_WORLD, &worldRank );
+  MPI_Comm_rank( MPI_COMM_WORLD, &worldRank);
 #else
   worldRank = 0;
 #endif
@@ -72,10 +72,13 @@ int simError( void ) {
 
 int simError( void ) {
   
+  char errorMsg[MAX_SIM_ERROR_MSG_LENGTH];
+
+#ifdef IS_MPI
   int myError = 1;
   int isError;
-  char errorMsg[MAX_SIM_ERROR_MSG_LENGTH];
   char nodeMsg[MAX_SIM_ERROR_MSG_LENGTH];
+#endif
   
   strcpy(errorMsg, "OpenMD ");
   switch( painCave.severity ) {
@@ -115,36 +118,33 @@ int simError( void ) {
 
   if (painCave.isFatal) {
 #ifdef IS_MPI    
-    MPI_Allreduce( &myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD );
+    MPI_Allreduce(&myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
     MPI_Finalize();
 #endif
     exit(0);
-  } 
-
+  }  
   return 1;  
 }
- 
 
+
 void errorCheckPoint( void ){
-    
+  
   int myError = 0;
   int isError = 0;
-
+  
 #ifdef IS_MPI
-  MPI_Allreduce( &myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD );
+  MPI_Allreduce(&myError, &isError, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD);
 #else
   isError = myError;
 #endif
-
-  if( isError ){
-
+  
+  if( isError ){    
 #ifdef IS_MPI
     MPI_Finalize();
-#endif
-
+#endif    
     exit(0);
   }
-
+  
 #ifdef CHECKPOINT_VERBOSE  
   nChecks++;