test_send_terminate Subroutine

public subroutine test_send_terminate(this)

Arguments

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

Calls

proc~~test_send_terminate~~CallsGraph proc~test_send_terminate test_send_terminate assertequal assertequal proc~test_send_terminate->assertequal get_type_id get_type_id proc~test_send_terminate->get_type_id getmpicommunicator getmpicommunicator proc~test_send_terminate->getmpicommunicator getprocessrank getprocessrank proc~test_send_terminate->getprocessrank none~receive~4 MpiSocket%receive proc~test_send_terminate->none~receive~4 none~send~5 MpiSocket%send proc~test_send_terminate->none~send~5 mpi_get_count mpi_get_count none~receive~4->mpi_get_count mpi_probe mpi_probe none~receive~4->mpi_probe mpi_recv mpi_recv none~receive~4->mpi_recv none~decode ProtocolParser%decode none~receive~4->none~decode proc~mapl_return MAPL_Return none~receive~4->proc~mapl_return proc~mapl_verify MAPL_Verify none~receive~4->proc~mapl_verify mpi_send mpi_send none~send~5->mpi_send none~encode ProtocolParser%encode none~send~5->none~encode none~send~5->proc~mapl_return none~send~5->proc~mapl_verify deserialize deserialize none~decode->deserialize none~at~295 IntegerMessageMap%at none~decode->none~at~295 none~encode->get_type_id get_length get_length none~encode->get_length serialize serialize none~encode->serialize 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 none~find~75 IntegerMessageMap%find none~at~295->none~find~75

Source Code

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

      integer :: comm
      type (MpiSocket) :: s
      class (AbstractMessage), allocatable :: message
      type (ProtocolParser), target :: parser

      comm = this%getMpiCommunicator()
      parser = ProtocolParser()

      select case (this%getProcessRank())
      case (0) ! server
         s = MpiSocket(comm, 1, parser)
         call s%receive(message)
         @assertEqual(TERMINATE_ID, message%get_type_id())
      case (1) ! client
         s = MpiSocket(comm, 0, parser)
         call s%send(TerminateMessage())
      end select

   end subroutine test_send_terminate