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

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)
         allocate(message, source=s%receive())
         @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