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 int main( int argc, char **argv )
18 MTest_Init( &argc, &argv );
19 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
20 MPI_Comm_size( MPI_COMM_WORLD, &size );
24 MPI_Reduce ( &data, &result, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD );
25 MPI_Bcast ( &result, 1, MPI_INT, 0, MPI_COMM_WORLD );
29 if (result != correct_result) errors++;
31 MPI_Reduce ( &data, &result, 1, MPI_INT, MPI_MIN, 0, MPI_COMM_WORLD );
32 MPI_Bcast ( &result, 1, MPI_INT, 0, MPI_COMM_WORLD );
33 if (result != 0) errors++;
35 MPI_Reduce ( &data, &result, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD );
36 MPI_Bcast ( &result, 1, MPI_INT, 0, MPI_COMM_WORLD );
37 if (result != (size-1)) errors++;
39 MTest_Finalize( errors );
41 return MTestReturnValue( errors );