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 MpiSocket%receive proc~test_send_terminate->none~receive none~send~2 MpiSocket%send proc~test_send_terminate->none~send~2 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~2->mpi_send none~encode ProtocolParser%encode none~send~2->none~encode none~send~2->proc~mapl_return none~send~2->proc~mapl_verify deserialize deserialize none~decode->deserialize none~at~342 IntegerMessageMap%at none~decode->none~at~342 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~96 IntegerMessageMap%find none~at~342->none~find~96

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