Send fragment data to remote node coordinator Uses int64 for fragment_idx to handle large fragment indices that overflow int32.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_t), | intent(in) | :: | world_comm | |||
| integer(kind=int64), | intent(in) | :: | fragment_idx | |||
| integer, | intent(in) | :: | polymers(:,:) | |||
| integer, | intent(in) | :: | dest_rank |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int64), | private | :: | fragment_idx_int64 | ||||
| integer, | private, | allocatable | :: | fragment_indices(:) | |||
| integer, | private | :: | fragment_size | ||||
| integer(kind=int32), | private | :: | fragment_type | ||||
| type(request_t), | private | :: | req(4) |
subroutine send_fragment_to_node(world_comm, fragment_idx, polymers, dest_rank) !! Send fragment data to remote node coordinator !! Uses int64 for fragment_idx to handle large fragment indices that overflow int32. type(comm_t), intent(in) :: world_comm integer(int64), intent(in) :: fragment_idx integer, intent(in) :: dest_rank integer, intent(in) :: polymers(:, :) integer :: fragment_size integer(int32) :: fragment_type integer, allocatable :: fragment_indices(:) type(request_t) :: req(4) integer(int64) :: fragment_idx_int64 fragment_size = count(polymers(fragment_idx, :) > 0) allocate (fragment_indices(fragment_size)) fragment_indices = polymers(fragment_idx, 1:fragment_size) ! Standard MBE always uses monomer indices fragment_type = FRAGMENT_TYPE_MONOMERS ! TODO: serialize the data for better performance fragment_idx_int64 = int(fragment_idx, kind=int64) call isend(world_comm, fragment_idx_int64, dest_rank, TAG_NODE_FRAGMENT, req(1)) call isend(world_comm, fragment_type, dest_rank, TAG_NODE_FRAGMENT, req(2)) call isend(world_comm, fragment_size, dest_rank, TAG_NODE_FRAGMENT, req(3)) call isend(world_comm, fragment_indices, dest_rank, TAG_NODE_FRAGMENT, req(4)) ! Wait for all sends to complete call wait(req(1)) call wait(req(2)) call wait(req(3)) call wait(req(4)) deallocate (fragment_indices) end subroutine send_fragment_to_node