test_put_directory Subroutine

public subroutine test_put_directory(this)

Arguments

Type IntentOptional Attributes Name
class(MpiTestMethod), intent(inout) :: this

Calls

proc~~test_put_directory~~CallsGraph proc~test_put_directory test_put_directory assertequal assertequal proc~test_put_directory->assertequal getmpicommunicator getmpicommunicator proc~test_put_directory->getmpicommunicator none~free_directory_resources DirectoryService%free_directory_resources proc~test_put_directory->none~free_directory_resources none~get_directory DirectoryService%get_directory proc~test_put_directory->none~get_directory none~get_win DirectoryService%get_win proc~test_put_directory->none~get_win none~put_directory DirectoryService%put_directory proc~test_put_directory->none~put_directory mpi_barrier mpi_barrier none~free_directory_resources->mpi_barrier mpi_comm_free mpi_comm_free none~free_directory_resources->mpi_comm_free mpi_free_mem mpi_free_mem none~free_directory_resources->mpi_free_mem mpi_win_free mpi_win_free none~free_directory_resources->mpi_win_free none~free_mpi_resources MpiMutex%free_mpi_resources none~free_directory_resources->none~free_mpi_resources proc~mapl_return MAPL_Return none~free_directory_resources->proc~mapl_return proc~mapl_verify MAPL_Verify none~free_directory_resources->proc~mapl_verify mpi_get mpi_get none~get_directory->mpi_get mpi_win_lock mpi_win_lock none~get_directory->mpi_win_lock mpi_win_unlock mpi_win_unlock none~get_directory->mpi_win_unlock none~get_directory->proc~mapl_verify mpi_put mpi_put none~put_directory->mpi_put none~put_directory->mpi_win_lock none~put_directory->mpi_win_unlock none~put_directory->proc~mapl_verify none~free_mpi_resources->mpi_comm_free none~free_mpi_resources->mpi_free_mem none~free_mpi_resources->mpi_win_free none~free_mpi_resources->proc~mapl_verify mpi_type_free mpi_type_free none~free_mpi_resources->mpi_type_free at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_put_directory(this)
      class (MpiTestMethod), intent(inout) :: this

      type (DirectoryService) :: ds
      integer :: comm
      integer :: win
      type (Directory) :: dir, dir2

      comm = this%getMpiCommunicator()
      ds = DirectoryService(comm)

      dir%num_entries = 1
      dir%entries(1) = DirectoryEntry('foo', 1)

      win = ds%get_win('server_directory')
      call ds%put_directory(dir, win)

      dir2 = ds%get_directory(win)

      @assertEqual(dir%num_entries, dir2%num_entries)
      @assertEqual(dir%entries(1)%port_name, dir%entries(1)%port_name)
      @assertEqual(dir%entries(1)%partner_root_rank, dir%entries(1)%partner_root_rank)

      call ds%free_directory_resources()

   end subroutine test_put_directory