1 ! This file created from test/mpi/f77/rma/baseattrwinf.f with f77tof90
2 ! -*- Mode: Fortran; -*-
4 ! (C) 2003 by Argonne National Laboratory.
5 ! See COPYRIGHT in top-level directory.
9 integer (kind=MPI_ADDRESS_KIND) extrastate, valin, valout, val
17 ! Include addsize defines asize as an address-sized integer
18 integer (kind=MPI_ADDRESS_KIND) asize
23 call mtest_init( ierr )
24 call mpi_comm_size( MPI_COMM_WORLD, commsize, ierr )
26 ! Create a window; then extract the values
29 call MPI_Win_create( base, asize, disp, MPI_INFO_NULL, &
30 & MPI_COMM_WORLD, win, ierr )
32 ! In order to check the base, we need an address-of function.
33 ! We use MPI_Get_address, even though that isn't strictly correct
34 call MPI_Win_get_attr( win, MPI_WIN_BASE, valout, flag, ierr )
37 print *, "Could not get WIN_BASE"
39 ! There is no easy way to get the actual value of base to compare
40 ! against. MPI_Address gives a value relative to MPI_BOTTOM, which
41 ! is different from 0 in Fortran (unless you can define MPI_BOTTOM
42 ! as something like %pointer(0)).
45 !C For this Fortran 77 version, we use the older MPI_Address function
46 ! call MPI_Address( base, baseadd, ierr )
47 ! if (valout .ne. baseadd) then
49 ! print *, "Got incorrect value for WIN_BASE (", valout,
50 ! & ", should be ", baseadd, ")"
54 call MPI_Win_get_attr( win, MPI_WIN_SIZE, valout, flag, ierr )
57 print *, "Could not get WIN_SIZE"
59 if (valout .ne. asize) then
61 print *, "Got incorrect value for WIN_SIZE (", valout, &
62 & ", should be ", asize, ")"
66 call MPI_Win_get_attr( win, MPI_WIN_DISP_UNIT, valout, flag, ierr)
69 print *, "Could not get WIN_DISP_UNIT"
71 if (valout .ne. disp) then
73 print *, "Got wrong value for WIN_DISP_UNIT (", valout, &
74 & ", should be ", disp, ")"
78 call MPI_Win_free( win, ierr )
80 call mtest_finalize( errs )
81 call MPI_Finalize( ierr )