/* Jonathan Hauenstein - University of Notre Dame Center for Applied Mathematics Minicourse on Parallel Computing April 24, May 1, May 8, 2008 Sample programs are designed for educational use */ #include #include int main(int argc, char **argv) { int my_id, num_proc; // initialize MPI MPI_Init(&argc, &argv); // find unique id MPI_Comm_rank(MPI_COMM_WORLD, &my_id); // wait until everybody is initialized MPI_Barrier(MPI_COMM_WORLD); if (my_id == 0) { // abort the program with error code 999 MPI_Abort(MPI_COMM_WORLD, 999); } else { // have everyone else wait here MPI_Barrier(MPI_COMM_WORLD); } // finalize MPI MPI_Finalize(); return 0; }