Send shard-assignment ids and polymer matrix to a destination rank.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_t), | intent(in) | :: | world_comm | |||
| integer, | intent(in) | :: | dest_rank | |||
| integer(kind=int64), | intent(in) | :: | ids(:) | |||
| integer, | intent(in) | :: | matrix(:,:) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | allocatable | :: | buf(:) | |||
| integer(kind=int32), | private | :: | n_cols | ||||
| integer(kind=int64), | private | :: | n_rows | ||||
| type(request_t), | private | :: | req(4) |
subroutine send_group_assignment_matrix(world_comm, dest_rank, ids, matrix) !! Send shard-assignment ids and polymer matrix to a destination rank. type(comm_t), intent(in) :: world_comm integer, intent(in) :: dest_rank integer(int64), intent(in) :: ids(:) integer, intent(in) :: matrix(:, :) integer(int64) :: n_rows integer(int32) :: n_cols integer, allocatable :: buf(:) type(request_t) :: req(4) n_rows = size(ids, kind=int64) n_cols = size(matrix, 2) call isend(world_comm, n_rows, dest_rank, TAG_GROUP_ASSIGN, req(1)) call isend(world_comm, ids, dest_rank, TAG_GROUP_ASSIGN, req(2)) call isend(world_comm, n_cols, dest_rank, TAG_GROUP_POLYMERS, req(3)) if (n_rows > 0_int64 .and. n_cols > 0) then allocate (buf(n_rows*n_cols)) buf = reshape(matrix, [n_rows*n_cols]) else allocate (buf(0)) end if call isend(world_comm, buf, dest_rank, TAG_GROUP_POLYMERS, req(4)) call wait(req(1)) call wait(req(2)) call wait(req(3)) call wait(req(4)) deallocate (buf) end subroutine send_group_assignment_matrix