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 );
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 );