send_pie_term_to_node Subroutine

private subroutine send_pie_term_to_node(world_comm, term_idx, pie_atom_sets, dest_rank)

Send PIE term (atom list) to remote node coordinator

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: world_comm
integer(kind=int64), intent(in) :: term_idx
integer, intent(in) :: pie_atom_sets(:,:)
integer, intent(in) :: dest_rank

Calls

proc~~send_pie_term_to_node~~CallsGraph proc~send_pie_term_to_node send_pie_term_to_node isend isend proc~send_pie_term_to_node->isend

Called by

proc~~send_pie_term_to_node~~CalledByGraph proc~send_pie_term_to_node send_pie_term_to_node proc~gmbe_pie_coordinator gmbe_pie_coordinator proc~gmbe_pie_coordinator->proc~send_pie_term_to_node proc~gmbe_run_distributed gmbe_context_t%gmbe_run_distributed proc~gmbe_run_distributed->proc~gmbe_pie_coordinator

Variables

Type Visibility Attributes Name Initial
integer, private, allocatable :: atom_list(:)
integer(kind=int32), private :: fragment_type
integer, private :: max_atoms
integer, private :: n_atoms
type(request_t), private :: req(4)

Source Code

   subroutine send_pie_term_to_node(world_comm, term_idx, pie_atom_sets, dest_rank)
      !! Send PIE term (atom list) to remote node coordinator
      type(comm_t), intent(in) :: world_comm
      integer(int64), intent(in) :: term_idx
      integer, intent(in) :: pie_atom_sets(:, :)
      integer, intent(in) :: dest_rank

      integer :: n_atoms, max_atoms
      integer, allocatable :: atom_list(:)
      integer(int32) :: fragment_type
      type(request_t) :: req(4)

      ! PIE terms always use atom lists
      fragment_type = FRAGMENT_TYPE_ATOMS

      ! Extract atom list for this term
      max_atoms = size(pie_atom_sets, 1)
      n_atoms = 0
      do while (n_atoms < max_atoms .and. pie_atom_sets(n_atoms + 1, term_idx) >= 0)
         n_atoms = n_atoms + 1
      end do

      allocate (atom_list(n_atoms))
      atom_list = pie_atom_sets(1:n_atoms, term_idx)

      call isend(world_comm, term_idx, dest_rank, TAG_NODE_FRAGMENT, req(1))
      call isend(world_comm, fragment_type, dest_rank, TAG_NODE_FRAGMENT, req(2))
      call isend(world_comm, n_atoms, dest_rank, TAG_NODE_FRAGMENT, req(3))
      call isend(world_comm, atom_list, dest_rank, TAG_NODE_FRAGMENT, req(4))

      call wait(req(1))
      call wait(req(2))
      call wait(req(3))
      call wait(req(4))

      deallocate (atom_list)
   end subroutine send_pie_term_to_node