X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c81c99a491282f76757c2673961e3cdee6853539..bc48db087894fd960073b3120cebf90e6b2f8c02:/teshsuite/smpi/mpich3-test/coll/red3.c diff --git a/teshsuite/smpi/mpich3-test/coll/red3.c b/teshsuite/smpi/mpich3-test/coll/red3.c index 32358d992d..3d23759611 100644 --- a/teshsuite/smpi/mpich3-test/coll/red3.c +++ b/teshsuite/smpi/mpich3-test/coll/red3.c @@ -160,9 +160,15 @@ int main( int argc, char *argv[] ) MPI_Type_commit( &mattype ); buf = (int *)malloc( count * size * size * sizeof(int) ); - if (!buf) MPI_Abort( MPI_COMM_WORLD, 1 ); + if (!buf) { + MPI_Abort( MPI_COMM_WORLD, 1 ); + exit(1); + } bufout = (int *)malloc( count * size * size * sizeof(int) ); - if (!bufout) MPI_Abort( MPI_COMM_WORLD, 1 ); + if (!bufout) { + MPI_Abort( MPI_COMM_WORLD, 1 ); + exit(1); + } for (root = 0; root < size; root ++) { initMat( comm, buf ); @@ -182,6 +188,16 @@ int main( int argc, char *argv[] ) if (rank == root) { errs += isShiftLeft( comm, bufout ); } + +#if MTEST_HAVE_MIN_MPI_VERSION(2,2) + /* Try one more time without IN_PLACE to make sure we check + * aliasing correctly */ + if (rank == root) { + MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); + if (MPI_SUCCESS == MPI_Reduce( bufout, bufout, count, mattype, op, root, comm )) + errs++; + } +#endif } free( buf );