1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2001 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
10 * This example should be run with 2 processes and tests the ability of the
11 * implementation to handle a flood of one-way messages.
14 int main(int argc, char **argv)
16 double wscale = 10.0, scale;
17 int numprocs, myid, i;
19 MPI_Init(&argc, &argv);
20 MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
21 MPI_Comm_rank(MPI_COMM_WORLD, &myid);
23 for (i = 0; i < 1000; i++) {
24 MPI_Allreduce(&wscale, &scale, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
28 /* If we get here at all, we're ok */
29 printf(" No Errors\n");