Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have some mpich3 tests use the automatic privatization instead of manual one.
[simgrid.git] / teshsuite / smpi / mpich3-test / init / initstat.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *
4  *  (C) 2003 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7 #include "mpi.h"
8 #include <stdio.h>
9 #include "mpitest.h"
10
11 int main( int argc, char *argv[] )
12 {
13     int errs = 0;
14     int provided, flag, claimed;
15
16     /* MTest_Init( &argc, &argv ); */
17
18     MPI_Init_thread( &argc, &argv, MPI_THREAD_MULTIPLE, &provided );
19     
20     MPI_Is_thread_main( &flag );
21     if (!flag) {
22         errs++;
23         printf( "This thread called init_thread but Is_thread_main gave false\n" );
24     }
25     MPI_Query_thread( &claimed );
26     if (claimed != provided) {
27         errs++;
28         printf( "Query thread gave thread level %d but Init_thread gave %d\n",
29                 claimed, provided );
30     }
31
32     MTest_Finalize( errs );
33     MPI_Finalize();
34     return 0;
35   
36 }