1 C -*- Mode: Fortran; -*-
3 C (C) 2003 by Argonne National Laboratory.
4 C See COPYRIGHT in top-level directory.
16 C Include addsize defines asize as an address-sized integer
21 call mtest_init( ierr )
22 call mpi_comm_size( MPI_COMM_WORLD, commsize, ierr )
24 C Create a window; then extract the values
27 call MPI_Win_create( base, asize, disp, MPI_INFO_NULL,
28 & MPI_COMM_WORLD, win, ierr )
30 C In order to check the base, we need an address-of function.
31 C We use MPI_Get_address, even though that isn't strictly correct
32 call MPI_Win_get_attr( win, MPI_WIN_BASE, valout, flag, ierr )
35 print *, "Could not get WIN_BASE"
37 C There is no easy way to get the actual value of base to compare
38 C against. MPI_Address gives a value relative to MPI_BOTTOM, which
39 C is different from 0 in Fortran (unless you can define MPI_BOTTOM
40 C as something like %pointer(0)).
43 CC For this Fortran 77 version, we use the older MPI_Address function
44 C call MPI_Address( base, baseadd, ierr )
45 C if (valout .ne. baseadd) then
47 C print *, "Got incorrect value for WIN_BASE (", valout,
48 C & ", should be ", baseadd, ")"
52 call MPI_Win_get_attr( win, MPI_WIN_SIZE, valout, flag, ierr )
55 print *, "Could not get WIN_SIZE"
57 if (valout .ne. asize) then
59 print *, "Got incorrect value for WIN_SIZE (", valout,
60 & ", should be ", asize, ")"
64 call MPI_Win_get_attr( win, MPI_WIN_DISP_UNIT, valout, flag, ierr)
67 print *, "Could not get WIN_DISP_UNIT"
69 if (valout .ne. disp) then
71 print *, "Got wrong value for WIN_DISP_UNIT (", valout,
72 & ", should be ", disp, ")"
76 call MPI_Win_free( win, ierr )
78 call mtest_finalize( errs )
79 call MPI_Finalize( ierr )