implicit_gather_scatter Module

Hybrid cpp split mirrors src/parallel_reductions.F90 and src/solution_gather.F90: MS-MPI ships only the legacy use mpi module; OpenMPI ships both and we prefer mpi_f08 for strong typing.



Subroutines

public subroutine gather_field_to_root(local_field, n_local, decomp, gather_buf)

Gather (neq, n_local) slices from every rank into (neq, n_global) on rank 0 via MPI_Gatherv. On non-root ranks gather_buf is not accessed; pass a (neq, 0) sentinel allocation.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: local_field(:,:)
integer, intent(in) :: n_local
type(decomp_t), intent(in) :: decomp
real(kind=wp), intent(inout) :: gather_buf(:,:)

public subroutine scatter_field_from_root(gather_buf, decomp, local_field, n_local)

Scatter (neq, n_global) on rank 0 into per-rank (neq, n_local) slices via MPI_Scatterv. On non-root ranks gather_buf is not accessed; pass a (neq, 0) sentinel allocation.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: gather_buf(:,:)
type(decomp_t), intent(in) :: decomp
real(kind=wp), intent(inout) :: local_field(:,:)
integer, intent(in) :: n_local

private subroutine build_counts_displs(decomp, counts, displs)

Arguments

Type IntentOptional Attributes Name
type(decomp_t), intent(in) :: decomp
integer, intent(out), allocatable :: counts(:)
integer, intent(out), allocatable :: displs(:)