1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/
#include <stdio.h>
#include "mpi.h"
#include "mpitest.h"
/*
* This example should be run with 2 processes and tests the ability of the
* implementation to handle a flood of one-way messages.
*/
int main(int argc, char **argv)
{
double wscale = 10.0, scale;
int numprocs, myid, i;
MTest_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
for (i = 0; i < 10000; i++) {
MPI_Allreduce(&wscale, &scale, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
}
MTest_Finalize(0);
return 0;
}
|