int main(int argc, char **argv) { int err, errs = 0; MTest_Init(&argc, &argv); parse_args(argc, argv); /* To improve reporting of problems about operations, we * change the error handler to errors return */ MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN); /* perform some tests */ err = blockindexed_contig_test(); if (err && verbose) fprintf(stderr, "%d errors in blockindexed test.\n", err); errs += err; err = blockindexed_vector_test(); if (err && verbose) fprintf(stderr, "%d errors in blockindexed vector test.\n", err); errs += err; MTest_Finalize(errs); return MTestReturnValue(errs); }
int main(int argc, char **argv) { int err, errs = 0; MPI_Init(&argc, &argv); /* MPI-1.2 doesn't allow for MPI_Init(0,0) */ parse_args(argc, argv); /* To improve reporting of problems about operations, we change the error handler to errors return */ MPI_Comm_set_errhandler( MPI_COMM_WORLD, MPI_ERRORS_RETURN ); /* perform some tests */ err = blockindexed_contig_test(); if (err && verbose) fprintf(stderr, "%d errors in blockindexed test.\n", err); errs += err; err = blockindexed_vector_test(); if (err && verbose) fprintf(stderr, "%d errors in blockindexed vector test.\n", err); errs += err; /* print message and exit */ if (errs) { fprintf(stderr, "Found %d errors\n", errs); } else { printf(" No Errors\n"); } MPI_Finalize(); return 0; }