1 C -*- Mode: Fortran; -*-
3 C (C) 2003 by Argonne National Laboratory.
4 C See COPYRIGHT in top-level directory.
11 character*(MPI_MAX_OBJECT_NAME) cname
14 C Include addsize defines asize as an address-sized integer
19 call mtest_init( ierr )
21 C Create a window and get, set the names on it
23 call mpi_type_size( MPI_INTEGER, intsize, ierr )
25 call mpi_win_create( buf, asize, intsize,
26 & MPI_INFO_NULL, MPI_COMM_WORLD, win, ierr )
28 C Check that there is no name yet
31 call mpi_win_get_name( win, cname, rlen, ierr )
34 print *, ' Did not get empty name from new window'
35 else if (cname(1:6) .ne. 'XXXXXX') then
37 do ln=MPI_MAX_OBJECT_NAME,1,-1
38 if (cname(ln:ln) .ne. ' ') then
44 print *, ' Found a non-empty name'
48 C Now, set a name and check it
49 call mpi_win_set_name( win, 'MyName', ierr )
52 call mpi_win_get_name( win, cname, rlen, ierr )
55 print *, ' Expected 6, got ', rlen, ' for rlen'
56 if (rlen .gt. 0 .and. rlen .lt. MPI_MAX_OBJECT_NAME) then
57 print *, ' Cname = ', cname(1:rlen)
59 else if (cname(1:6) .ne. 'MyName') then
61 print *, ' Expected MyName, got ', cname(1:6)
64 do ln=MPI_MAX_OBJECT_NAME,7,-1
65 if (cname(ln:ln) .ne. ' ') then
71 print *, ' window name is not blank padded'
75 call mpi_win_free( win, ierr )
76 call mtest_finalize( errs )
77 call mpi_finalize( ierr )