decompose Function

public pure function decompose(my_rank, n_ranks, n_global, halo_width, is_periodic) result(d)

Compute this rank's decomposition. Pure: no MPI calls, no global state.

Slab partition: floor(n_global / n_ranks) cells per rank, with the remainder distributed to the first (n_global mod n_ranks) ranks. This is the standard "block" partition used by virtually every 1D MPI decomposition; it minimises the cell-count spread.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: my_rank
integer, intent(in) :: n_ranks
integer, intent(in) :: n_global
integer, intent(in) :: halo_width
logical, intent(in) :: is_periodic

Return Value type(decomp_t)