Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
reduce some tests duration as comm_create takes longer now (comms)
[simgrid.git] / teshsuite / smpi / mpich3-test / util / mtestcheck.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *  (C) 2008 by Argonne National Laboratory.
4  *      See COPYRIGHT in top-level directory.
5  */
6 #include "mpi.h"
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "mpitest.h"
10
11 int main(int argc, char *argv[])
12 {
13     int errs = 0;
14     MPI_Comm comm;
15     int minsize = 2, csize, count;
16
17     MTest_Init(&argc, &argv);
18
19     while (MTestGetIntracommGeneral(&comm, minsize, 1)) {
20         if (comm == MPI_COMM_NULL)
21             continue;
22
23         MPI_Comm_size(comm, &csize);
24         count = 128000;
25         {
26             int *ap, *bp;
27             int root;
28             ap = (int *) malloc(count * sizeof(int));
29             bp = (int *) malloc(count * sizeof(int));
30             root = 0;
31             MPI_Reduce(ap, bp, count, MPI_INT, MPI_SUM, root, comm);
32             free(ap);
33             free(bp);
34         }
35         MTestFreeComm(&comm);
36     }
37
38     MTest_Finalize(errs);
39
40     MPI_Finalize();
41
42     return 0;
43 }