1 ! This file created from test/mpi/f77/rma/winnamef.f with f77tof90
2 ! -*- Mode: Fortran; -*-
4 ! (C) 2003 by Argonne National Laboratory.
5 ! See COPYRIGHT in top-level directory.
11 character*(MPI_MAX_OBJECT_NAME) cname
14 ! Include addsize defines asize as an address-sized integer
15 integer (kind=MPI_ADDRESS_KIND) asize
20 call mtest_init( ierr )
22 ! Create a window and get, set the names on it
24 call mpi_type_size( MPI_INTEGER, intsize, ierr )
26 call mpi_win_create( buf, asize, intsize, &
27 & MPI_INFO_NULL, MPI_COMM_WORLD, win, ierr )
29 ! Check that there is no name yet
32 call mpi_win_get_name( win, cname, rlen, ierr )
35 print *, ' Did not get empty name from new window'
36 else if (cname(1:6) .ne. 'XXXXXX') then
38 do ln=MPI_MAX_OBJECT_NAME,1,-1
39 if (cname(ln:ln) .ne. ' ') then
45 print *, ' Found a non-empty name'
49 ! Now, set a name and check it
50 call mpi_win_set_name( win, 'MyName', ierr )
53 call mpi_win_get_name( win, cname, rlen, ierr )
56 print *, ' Expected 6, got ', rlen, ' for rlen'
57 if (rlen .gt. 0 .and. rlen .lt. MPI_MAX_OBJECT_NAME) then
58 print *, ' Cname = ', cname(1:rlen)
60 else if (cname(1:6) .ne. 'MyName') then
62 print *, ' Expected MyName, got ', cname(1:6)
65 do ln=MPI_MAX_OBJECT_NAME,7,-1
66 if (cname(ln:ln) .ne. ' ') then
72 print *, ' window name is not blank padded'
76 call mpi_win_free( win, ierr )
77 call mtest_finalize( errs )
78 call mpi_finalize( ierr )