2 C Check the communicator naming functions from Fortran
10 character*40 other_name
17 call mpi_comm_get_name (MPI_COMM_WORLD, the_name, namelen, error)
18 if (error .ne. mpi_success) then
20 print *,'Failed to get the name from MPI_COMM_WORLD'
21 call MPI_Abort( MPI_COMM_WORLD, 1, error )
24 if (the_name .ne. 'MPI_COMM_WORLD') then
26 print *,'The name on MPI_COMM_WORLD is not "MPI_COMM_WORLD"'
27 call MPI_Abort( MPI_COMM_WORLD, 1, error )
30 other_name = 'foobarH'
31 call mpi_comm_set_name(MPI_COMM_WORLD, other_name(1:6), error)
33 if (error .ne. mpi_success) then
35 print *,'Failed to put a name onto MPI_COMM_WORLD'
36 call MPI_Abort( MPI_COMM_WORLD, 1, error )
41 call mpi_comm_get_name (MPI_COMM_WORLD, the_name, namelen, error)
42 if (error .ne. mpi_success) then
44 print *,'Failed to get the name from MPI_COMM_WORLD ',
46 call MPI_Abort( MPI_COMM_WORLD, 1, error )
49 if (the_name .ne. 'foobar') then
51 print *,'The name on MPI_COMM_WORLD is not "foobar"'
52 print *, 'Got ', the_name
53 call MPI_Abort( MPI_COMM_WORLD, 1, error )
56 call mpi_comm_rank( MPI_COMM_WORLD, rank, error )
57 if (errcnt .eq. 0 .and. rank .eq. 0) then
60 call mpi_finalize(error)
64 subroutine xify( string )