1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
4 * (C) 2001 by Argonne National Laboratory.
5 * See COPYRIGHT in top-level directory.
11 int main( int argc, char **argv)
22 MTest_Init( &argc, &argv );
23 MPI_Comm_size( MPI_COMM_WORLD, &size );
24 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
26 /* Create a window; then extract the values */
29 MPI_Win_create( base, n, disp, MPI_INFO_NULL, MPI_COMM_WORLD, &win );
31 MPI_Win_get_attr( win, MPI_WIN_BASE, &v, &flag );
34 fprintf( stderr, "Could not get WIN_BASE\n" );
37 /* MPI 2.1, section 11.2.2. v must be a pointer to the start of the
38 window. It is not a pointer to a pointer to the start of the window.
40 if ((int*)v != base) {
42 fprintf( stderr, "Got incorrect value for WIN_BASE (%p, should be %p)",
47 MPI_Win_get_attr( win, MPI_WIN_SIZE, &v, &flag );
50 fprintf( stderr, "Could not get WIN_SIZE\n" );
53 MPI_Aint vval = *(MPI_Aint*)v;
56 fprintf( stderr, "Got wrong value for WIN_SIZE (%ld, should be %ld)\n",
57 (long) vval, (long) n );
61 MPI_Win_get_attr( win, MPI_WIN_DISP_UNIT, &v, &flag );
64 fprintf( stderr, "Could not get WIN_DISP_UNIT\n" );
70 fprintf( stderr, "Got wrong value for WIN_DISP_UNIT (%d, should be %d)\n",
76 MTest_Finalize( errs );