--- trunk/src/utils/simError.c 2010/05/10 17:28:26 1442 +++ branches/development/src/utils/simError.cpp 2012/01/06 19:03:05 1668 @@ -36,7 +36,8 @@ * [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). - * [4] Vardeman & Gezelter, in progress (2009). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #include @@ -92,22 +93,24 @@ int simError( void ) { } #ifdef IS_MPI - if ( painCave.isEventLoop ) { - sprintf( nodeMsg, " (reported by MPI node %d)", worldRank); - strncat(errorMsg, nodeMsg, strlen(nodeMsg)); - } + if (worldRank == 0) { + if ( painCave.isEventLoop ) { + sprintf( nodeMsg, " (reported by MPI node %d)", worldRank); + strncat(errorMsg, nodeMsg, strlen(nodeMsg)); + } #endif - - strcat(errorMsg, ":\n\t"); - - strncat(errorMsg, painCave.errMsg, strlen(painCave.errMsg)); - - strcat(errorMsg, "\n"); - fprintf(stderr, errorMsg); - + + strcat(errorMsg, ":\n\t"); + + strncat(errorMsg, painCave.errMsg, strlen(painCave.errMsg)); + + strcat(errorMsg, "\n"); + fprintf(stderr, "%s", errorMsg); + #ifdef IS_MPI - if (painCave.isEventLoop) - return 1; + if (painCave.isEventLoop) + return 1; + } #endif if (painCave.isFatal) {