aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/dist.hh
diff options
context:
space:
mode:
authoreschnett <>2001-03-05 20:48:00 +0000
committereschnett <>2001-03-05 20:48:00 +0000
commitbf8a79404ea420deb2db0590e914be15aa716ae2 (patch)
tree7ce6962d390884f8dde308d329d4c3b8fb50d886 /Carpet/CarpetLib/src/dist.hh
parent81af973d982aa9714d0dfdb25150820490ed2d9d (diff)
Made it work on multiple processors. Waved a dead chicken. Maybe the
Made it work on multiple processors. Waved a dead chicken. Maybe the debug output makes it work, maybe only the MPI startup procedure is flaky. darcs-hash:20010305204828-f6438-a2a24ca201018669042bb75cabb0868251cd61b7.gz
Diffstat (limited to 'Carpet/CarpetLib/src/dist.hh')
-rw-r--r--Carpet/CarpetLib/src/dist.hh30
1 files changed, 29 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/dist.hh b/Carpet/CarpetLib/src/dist.hh
index 09645a716..e62bb94da 100644
--- a/Carpet/CarpetLib/src/dist.hh
+++ b/Carpet/CarpetLib/src/dist.hh
@@ -5,7 +5,7 @@
copyright : (C) 2000 by Erik Schnetter
email : schnetter@astro.psu.edu
- $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dist.hh,v 1.1 2001/03/01 13:40:10 eschnett Exp $
+ $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dist.hh,v 1.2 2001/03/05 21:48:38 eschnett Exp $
***************************************************************************/
@@ -22,6 +22,7 @@
#define DIST_HH
#include <cassert>
+#include <cstdio>
#include <cstdlib>
#include <mpi.h>
@@ -30,6 +31,33 @@
+// A checkpoint for debugging purposes
+#define DIST_VERBOSE \
+do { \
+ int rank; \
+ MPI_Comm_rank (dist::comm, &rank); \
+ printf ("CHECKPOINT: processor %d, file %s, line %d\n", \
+ rank, __FILE__, __LINE__); \
+} while(0)
+
+// A barrier for debugging purposes
+#define DIST_BARRIER \
+do { \
+ MPI_Barrier(dist::comm); \
+} while(0)
+
+// Both of the above
+#define DIST_VERBOSE_BARRIER \
+do { \
+ DIST_VERBOSE; \
+ DIST_BARRIER; \
+} while(0)
+
+// Do nothing
+#define DIST_NODEBUG do {} while(0)
+
+
+
struct dist {
static const int tag = 1;