aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2005-11-19 20:40:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2005-11-19 20:40:00 +0000
commit929a87c757f98d19de2b6a5d8cfd7e93732e4a10 (patch)
treea09656b4fe29e80f8ebfe17e7042f302b63182ae
parent7c83e264dd3e79fc35f553f6304711c626d6a2bf (diff)
Carpet: helpers, comm, goodcomm
Use dist::goodcomm() instead of checking dist::comm() in CCTK_MyProc() and CCTK_nProcs(). darcs-hash:20051119204056-dae7b-4317800ee26bec24010134ef595e7b157aa77623.gz
-rw-r--r--Carpet/Carpet/src/helpers.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/Carpet/Carpet/src/helpers.cc b/Carpet/Carpet/src/helpers.cc
index c76d3a0fa..ebf606a68 100644
--- a/Carpet/Carpet/src/helpers.cc
+++ b/Carpet/Carpet/src/helpers.cc
@@ -90,13 +90,8 @@ namespace Carpet {
{
void *dummy = &dummy;
dummy = &cgh;
-
- MPI_Comm comm = dist::comm;
- if (comm == MPI_COMM_NULL)
- {
- comm = MPI_COMM_WORLD;
- }
- MPI_Abort (comm, retval);
+
+ MPI_Abort (MPI_COMM_WORLD, retval);
abort ();
return -999;
}
@@ -105,19 +100,17 @@ namespace Carpet {
int MyProc (const cGH* cgh)
{
- // if there is no cgh yet, assume nothing has been initialised
- // yet, and don't use dist::comm
+ // This may be called very early, before dist:comm() is valid
int rank;
- MPI_Comm_rank (cgh ? dist::comm : MPI_COMM_WORLD, &rank);
+ MPI_Comm_rank (dist::goodcomm(), & rank);
return rank;
}
int nProcs (const cGH* cgh)
{
- // if there is no cgh yet, assume nothing has been initialised
- // yet, and don't use dist::comm
+ // This may be called very early, before dist:comm() is valid
int size;
- MPI_Comm_size (cgh ? dist::comm : MPI_COMM_WORLD, &size);
+ MPI_Comm_size (dist::goodcomm(), & size);
return size;
}