Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add MPICH3 rma tests (15 out of 88 should be passing now)
[simgrid.git] / teshsuite / smpi / mpich3-test / rma / winname.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *
4  *  (C) 2001 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7
8 #include "mpi.h"
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include "mpitestconf.h"
12 #include "mpitest.h"
13 #ifdef HAVE_STRING_H
14 #include <string.h>
15 #endif
16
17 int main( int argc, char *argv[] )
18 {
19     int errs = 0;
20     MPI_Win win;
21     int cnt, namelen;
22     char name[MPI_MAX_OBJECT_NAME], nameout[MPI_MAX_OBJECT_NAME];
23
24     MTest_Init( &argc, &argv );
25
26     cnt = 0;
27     while (MTestGetWin( &win, 1 )) {
28         if (win == MPI_WIN_NULL) continue;
29     
30         sprintf( name, "win-%d", cnt );
31         cnt++;
32         MPI_Win_set_name( win, name );
33         nameout[0] = 0;
34         MPI_Win_get_name( win, nameout, &namelen );
35         if (strcmp( name, nameout )) {
36             errs++;
37             printf( "Unexpected name, was %s but should be %s\n",
38                     nameout, name );
39         }
40
41         MTestFreeWin( &win );
42     }
43
44     MTest_Finalize( errs );
45     MPI_Finalize();
46     return 0;
47 }