MPIOperations

PinCFlow.MPIOperationsModule
MPIOperations

Module for operations that require communication between MPI processes.

Provides halo exchange functions for maintaining field continuity across process boundaries, as well as global reduction operations.

See also

PinCFlow.MPIOperations.compute_global_dot_productFunction
compute_global_dot_product(
    a::AbstractArray{<:AbstractFloat, 3},
    b::AbstractArray{<:AbstractFloat, 3},
    state::State,
)::AbstractFloat

Compute and return the dot product $\boldsymbol{a} \cdot \boldsymbol{b} = \sum_i a_i \cdot b_i$ of two 3D arrays distributed across MPI processes.

Arguments

  • a: First input array.

  • b: Second input array (must have the same shape as a).

  • state: Model state.

PinCFlow.MPIOperations.set_meridional_halos_of_field!Function
set_meridional_halos_of_field!(
    field::AbstractMatrix{<:AbstractFloat},
    namelists::Namelists,
    domain::Domain,
)

Exchange all meridional halo values of a matrix by performing bidirectional MPI communication between backward and forward neighbor processes.

set_meridional_halos_of_field!(
    field::AbstractArray{<:Real, 3},
    namelists::Namelists,
    domain::Domain;
    layers::NTuple{3, <:Integer} = (-1, -1, -1),
)

Exchange a specified number of meridional halo values of a 3D array with an algorithm similar to that implemented in the method for matrices.

set_meridional_halos_of_field!(
    field::AbstractArray{<:AbstractFloat, 5},
    namelists::Namelists,
    domain::Domain;
    layers::NTuple{3, <:Integer} = (-1, -1, -1),
)

Exchange a specified number of meridional halo values of a 5D array with an algorithm similar to that implemented in the method for 3D arrays.

The first three dimensions of the array are assumed to represent the dimensions of physical space.

Arguments

  • field: Input array.

  • namelists: Namelists with all model parameters.

  • domain: Collection of domain-decomposition and MPI-communication parameters.

Keywords

  • layers: The number of halo layers in each dimension. Use -1 for the default values from namelists.
PinCFlow.MPIOperations.set_vertical_halos_of_field!Function
set_vertical_halos_of_field!(
    field::AbstractArray{<:Real, 3},
    namelists::Namelists,
    domain::Domain;
    layers::NTuple{3, <:Integer} = (-1, -1, -1),
)

Exchange a specified number of vertical halo values of a 3D array by performing MPI communication between downward and upward neighbor processes.

Solid walls are assumed at the vertical boundaries of the domain. The corresponding ghost-cell values are not changed.

set_vertical_halos_of_field!(
    field::AbstractArray{<:AbstractFloat, 5},
    namelists::Namelists,
    domain::Domain;
    layers::NTuple{3, <:Integer} = (-1, -1, -1),
)

Exchange a specified number of vertical halo values of a 5D array with an algorithm similar to that implemented in the above method.

The vertical domain boundaries are treated as described above. The first three dimensions of the array are assumed to represent the dimensions of physical space.

Arguments

  • field: Input array.

  • namelists: Namelists with all model parameters.

  • domain: Collection of domain-decomposition and MPI-communication parameters.

Keywords

  • layers: The number of halo layers in each dimension. Use -1 for the default values from namelists.
PinCFlow.MPIOperations.set_zonal_halos_of_field!Function
set_zonal_halos_of_field!(
    field::AbstractMatrix{<:AbstractFloat},
    namelists::Namelists,
    domain::Domain,
)

Exchange all zonal halo values of a matrix by performing bidirectional MPI communication between left and right neighbor processes.

set_zonal_halos_of_field!(
    field::AbstractArray{<:Real, 3},
    namelists::Namelists,
    domain::Domain;
    layers::NTuple{3, <:Integer} = (-1, -1, -1),
)

Exchange a specified number of zonal halo values of a 3D array with an algorithm similar to that implemented in the method for matrices.

set_zonal_halos_of_field!(
    field::AbstractArray{<:AbstractFloat, 5},
    namelists::Namelists,
    domain::Domain;
    layers::NTuple{3, <:Integer} = (-1, -1, -1),
)

Exchange a specified number of zonal halo values of a 5D array with an algorithm similar to that implemented in the method for 3D arrays.

The first three dimensions of the array are assumed to represent the dimensions of physical space.

Arguments

  • field: Input array.

  • namelists: Namelists with all model parameters.

  • domain: Collection of domain-decomposition and MPI-communication parameters.

Keywords

  • layers: The number of halo layers in each dimension. Use -1 for the default values from namelists.