halo_exchange Module

exchange_halos posts MPI_Irecv from each neighbour into this rank's halo cells, then MPI_Isend the matching interior slices, then MPI_Waitall on all four requests. Boundary ranks (with neighbour MPI_PROC_NULL) have those Isend/Irecv calls degenerate into silent no-ops by MPI standard, so the same code path runs at -np 1.

Only one buffer set (state%ub) is halo-exchanged today. If more halo'd arrays are ever added, generalize this module rather than duplicating the request-management logic.



Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: TAG_HALO_L = 1001
integer, private, parameter :: TAG_HALO_R = 1002

Subroutines

public subroutine exchange_halos(state, d)

Fill state%ub's halo cells from neighbours.

Arguments

Type IntentOptional Attributes Name
type(solver_state_t), intent(inout) :: state
type(decomp_t), intent(in) :: d