Send PIE term (atom list) to local worker
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_t), | intent(in) | :: | node_comm | |||
| integer(kind=int64), | intent(in) | :: | term_idx | |||
| integer, | intent(in) | :: | pie_atom_sets(:,:) | |||
| integer, | intent(in) | :: | dest_rank |
| 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) |
subroutine send_pie_term_to_worker(node_comm, term_idx, pie_atom_sets, dest_rank) !! Send PIE term (atom list) to local worker type(comm_t), intent(in) :: node_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(node_comm, term_idx, dest_rank, TAG_WORKER_FRAGMENT, req(1)) call isend(node_comm, fragment_type, dest_rank, TAG_WORKER_FRAGMENT, req(2)) call isend(node_comm, n_atoms, dest_rank, TAG_WORKER_FRAGMENT, req(3)) call isend(node_comm, atom_list, dest_rank, TAG_WORKER_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_worker