summaryrefslogtreecommitdiffstats
path: root/testpar/testpar.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-02-22 19:37:06 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-02-22 19:37:06 (GMT)
commit727b687ae6c80c9854cb53814fa1c12f27c2994c (patch)
treefabe359aaddbe3b4d1e2bb58ceb3b94311d66a1c /testpar/testpar.h
parent25486d50895fa4a30809d289b9aff4de583a9b84 (diff)
downloadhdf5-727b687ae6c80c9854cb53814fa1c12f27c2994c.zip
hdf5-727b687ae6c80c9854cb53814fa1c12f27c2994c.tar.gz
hdf5-727b687ae6c80c9854cb53814fa1c12f27c2994c.tar.bz2
[svn-r20146] Description:
Bring r19714:20145 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.6 (amazon) in debug mode Mac OS X/32 10.6.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'testpar/testpar.h')
-rw-r--r--testpar/testpar.h37
1 files changed, 23 insertions, 14 deletions
diff --git a/testpar/testpar.h b/testpar/testpar.h
index 02fc915..ce11204 100644
--- a/testpar/testpar.h
+++ b/testpar/testpar.h
@@ -26,25 +26,36 @@
/* Define some handy debugging shorthands, routines, ... */
/* debugging tools */
-#define MESG(x) \
- if (VERBOSE_MED) printf("%s\n", x); \
+/* Print message mesg if verbose level is at least medium and
+ * mesg is not an empty string.
+ */
+#define MESG(mesg) \
+ if (VERBOSE_MED && *mesg != '\0') \
+ printf("%s\n", mesg)
+/*
+ * VRFY: Verify if the condition val is true.
+ * If it is true, then call MESG to print mesg, depending on the verbose
+ * level.
+ * If val is not true, it prints error messages and if the verbose
+ * level is lower than medium, it calls MPI_Abort to abort the program.
+ * If verbose level is at least medium, it will not abort.
+ * This will allow program to continue and can be used for debugging.
+ * (The "do {...} while(0)" is to group all the statements as one unit.)
+ */
#define VRFY(val, mesg) do { \
if (val) { \
- if (*mesg != '\0') { \
- MESG(mesg); \
- } \
+ MESG(mesg); \
} else { \
printf("Proc %d: ", mpi_rank); \
- printf("*** PHDF5 ERROR ***\n"); \
- printf(" Assertion (%s) failed at line %4d in %s\n", \
+ printf("*** Parallel ERROR ***\n"); \
+ printf(" VRFY (%s) failed at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
++nerrors; \
fflush(stdout); \
- if (!VERBOSE_MED) { \
- printf("aborting MPI process\n"); \
- MPI_Finalize(); \
- exit(nerrors); \
+ if (!VERBOSE_MED) { \
+ printf("aborting MPI processes\n"); \
+ MPI_Abort(MPI_COMM_WORLD, 1); \
} \
} \
} while(0)
@@ -56,9 +67,7 @@
*/
#define INFO(val, mesg) do { \
if (val) { \
- if (*mesg != '\0') { \
- MESG(mesg); \
- } \
+ MESG(mesg); \
} else { \
printf("Proc %d: ", mpi_rank); \
printf("*** PHDF5 REMARK (not an error) ***\n"); \