#include "mpi.h"
#include "mpitest.h"
-/* This is a temporary #ifdef to control whether we test this functionality. A
- * configure-test or similar would be better. Eventually the MPI-3 standard
- * will be released and this can be gated on a MPI_VERSION check */
-#if !defined(USE_STRICT_MPI) && defined(MPICH)
-#define TEST_IDUP 1
-#endif
-
/* assert-like macro that bumps the err count and emits a message */
#define check(x_) \
do { \
MPI_Abort(MPI_COMM_WORLD, 1);
}
-#ifdef TEST_IDUP
-
/* test plan: make rank 0 wait in a blocking recv until all other processes
* have posted their MPI_Comm_idup ops, then post last. Should ensure that
* idup doesn't block on the non-zero ranks, otherwise we'll get a deadlock.
buf[0] = rank;
buf[1] = 0xfeedface;
MPI_Allreduce(&buf[0], &buf[1], 1, MPI_INT, MPI_SUM, newcomm);
- check(buf[1] == (size * (size-1) / 2));
+ check(buf[1] == (size * (size - 1) / 2));
MPI_Comm_free(&newcomm);
buf[0] = lrank;
buf[1] = 0xfeedface;
MPI_Allreduce(&buf[0], &buf[1], 1, MPI_INT, MPI_SUM, newcomm);
- check(buf[1] == (rsize * (rsize-1) / 2));
+ check(buf[1] == (rsize * (rsize - 1) / 2));
/* free this down here, not before idup, otherwise it will undo our
* stagger_comm work */
MPI_Comm_free(&newcomm);
MPI_Comm_free(&ic);
-#endif /* TEST_IDUP */
-
MPI_Reduce((rank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
if (rank == 0) {
if (errs) {
return 0;
}
-