In case the fine grid is on a different CPU, perform the prolongation and store the fine-grid values in the send buffer.
Todo
Check whether it's faster to send coarse data and prolong afterwards
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mg_t), | intent(inout) | :: | mg | |||
| integer, | intent(in) | :: | id | |||
| integer, | intent(in) | :: | nc | |||
| integer, | intent(in) | :: | iv | |||
| procedure(mg_box_prolong) | :: | method |
subroutine prolong_set_buffer(mg, id, nc, iv, method) type(mg_t), intent(inout) :: mg integer, intent(in) :: id integer, intent(in) :: nc integer, intent(in) :: iv procedure(mg_box_prolong) :: method integer :: i, dix(3) integer :: i_c, c_id, c_rank, dsize real(dp) :: tmp(nc, nc, nc) dsize = nc**3 do i_c = 1, mg_num_children c_id = mg%boxes(id)%children(i_c) if (c_id > mg_no_box) then c_rank = mg%boxes(c_id)%rank if (c_rank /= mg%my_rank) then dix = mg_get_child_offset(mg, c_id) call method(mg, id, dix, nc, iv, tmp) i = mg%buf(c_rank)%i_send mg%buf(c_rank)%send(i+1:i+dsize) = pack(tmp, .true.) mg%buf(c_rank)%i_send = mg%buf(c_rank)%i_send + dsize i = mg%buf(c_rank)%i_ix mg%buf(c_rank)%ix(i+1) = c_id mg%buf(c_rank)%i_ix = mg%buf(c_rank)%i_ix + 1 end if end if end do end subroutine prolong_set_buffer