handle_group_node_requests Subroutine

private subroutine handle_group_node_requests(resources, term_queue, term_ids, atom_sets, finished_nodes)

Uses

  • proc~~handle_group_node_requests~2~~UsesGraph proc~handle_group_node_requests~2 handle_group_node_requests module~mqc_resources mqc_resources proc~handle_group_node_requests~2->module~mqc_resources module~mqc_mpi_comms mqc_mpi_comms module~mqc_resources->module~mqc_mpi_comms pic_mpi_lib pic_mpi_lib module~mqc_mpi_comms->pic_mpi_lib

Arguments

Type IntentOptional Attributes Name
type(resources_t), intent(in) :: resources
type(queue_t), intent(inout) :: term_queue
integer(kind=int64), intent(in) :: term_ids(:)
integer, intent(in) :: atom_sets(:,:)
integer, intent(inout) :: finished_nodes

Calls

proc~~handle_group_node_requests~2~~CallsGraph proc~handle_group_node_requests~2 handle_group_node_requests iprobe iprobe proc~handle_group_node_requests~2->iprobe irecv irecv proc~handle_group_node_requests~2->irecv isend isend proc~handle_group_node_requests~2->isend proc~queue_pop queue_pop proc~handle_group_node_requests~2->proc~queue_pop proc~send_pie_term_payload send_pie_term_payload proc~handle_group_node_requests~2->proc~send_pie_term_payload proc~send_pie_term_payload->isend

Called by

proc~~handle_group_node_requests~2~~CalledByGraph proc~handle_group_node_requests~2 handle_group_node_requests proc~gmbe_group_global_coordinator gmbe_group_global_coordinator proc~gmbe_group_global_coordinator->proc~handle_group_node_requests~2 proc~gmbe_pie_coordinator gmbe_pie_coordinator proc~gmbe_pie_coordinator->proc~handle_group_node_requests~2 proc~gmbe_run_distributed gmbe_context_t%gmbe_run_distributed proc~gmbe_run_distributed->proc~gmbe_group_global_coordinator proc~gmbe_run_distributed->proc~gmbe_pie_coordinator

Variables

Type Visibility Attributes Name Initial
integer, private :: dummy_msg
logical, private :: has_item
logical, private :: has_pending
integer(kind=int64), private :: local_idx
type(request_t), private :: req
integer, private :: request_source
type(MPI_Status), private :: status
integer(kind=int64), private :: term_idx

Source Code

   subroutine handle_group_node_requests(resources, term_queue, term_ids, atom_sets, finished_nodes)
      use mqc_resources, only: resources_t
      type(resources_t), intent(in) :: resources
      type(queue_t), intent(inout) :: term_queue
      integer(int64), intent(in) :: term_ids(:)
      integer, intent(in) :: atom_sets(:, :)
      integer, intent(inout) :: finished_nodes

      integer :: request_source, dummy_msg
      integer(int64) :: local_idx, term_idx
      type(MPI_Status) :: status
      logical :: has_pending, has_item
      type(request_t) :: req

      call iprobe(resources%mpi_comms%world_comm, MPI_ANY_SOURCE, TAG_NODE_REQUEST, has_pending, status)
      if (.not. has_pending) return

      call irecv(resources%mpi_comms%world_comm, dummy_msg, status%MPI_SOURCE, TAG_NODE_REQUEST, req)
      call wait(req)
      request_source = status%MPI_SOURCE

      call queue_pop(term_queue, local_idx, has_item)
      if (has_item) then
         term_idx = term_ids(local_idx)
         call send_pie_term_payload(resources%mpi_comms%world_comm, TAG_NODE_FRAGMENT, term_idx, &
                                    atom_sets(:, local_idx), request_source)
      else
         call isend(resources%mpi_comms%world_comm, -1, request_source, TAG_NODE_FINISH, req)
         call wait(req)
         finished_nodes = finished_nodes + 1
      end if
   end subroutine handle_group_node_requests