Back-ends

MPI

PartitionedArrays.MPIArrayType
MPIArray{T,N}

Represent an array of element type T and number of dimensions N, where each item in the array is stored in a separate MPI process. I.e., each MPI rank stores only one item. For arrays that can store more than one item per rank see PVector or PSparseMatrix. This struct implements the Julia array interface. However, using setindex! and getindex! is disabled for performance reasons (communication cost).

Properties

The fields of this struct (and the inner constructors) are private. To generate an instance of MPIArray use function distribute_with_mpi.

Supertype hierarchy

MPIArray{T,N} <: AbstractArray{T,N}
source
PartitionedArrays.distribute_with_mpiMethod
distribute_with_mpi(a;comm::MPI.Comm=MPI.COMM_WORLD,duplicate_comm=true)

Create an MPIArray instance by distributing the items in the collection a over the ranks of the given MPI communicator comm. Each rank receives exactly one item, thus length(a) and the communicator size need to match. For arrays that can store more than one item per rank see PVector or PSparseMatrix. If duplicate_comm=false the result will take ownership of the given communicator. Otherwise, a copy will be done with MPI.Comm_dup(comm).

Note

This function calls MPI.Init() if MPI is not initialized yet.

source
PartitionedArrays.with_mpiMethod
with_mpi(f;comm=MPI.COMM_WORLD,duplicate_comm=true)

Call f(a->distribute_with_mpi(a;comm,duplicate_comm)) and abort MPI if there was an error. This is the safest way of running the function f using MPI.

Note

This function calls MPI.Init() if MPI is not initialized yet.

source

Debug

PartitionedArrays.DebugArrayType
struct DebugArray{T,N}

Data structure that emulates the limitations of MPIArray, but that can be used on a standard sequential (a.k.a. serial) Julia session. This struct implements the Julia array interface. Like for MPIArray, using setindex! and getindex on DebugArray is disabled since this will not be efficient in actual parallel runs (communication cost).

Properties

The fields of this struct are private.

Supertype hierarchy

DebugArray{T,N} <: AbstractArray{T,N}
source
PartitionedArrays.DebugArrayMethod
DebugArray(a)

Create a DebugArray{T,N} data object from the items in collection a, where T=eltype(a) and N=ndims(a) . If a::Array{T,N}, then the result takes ownership of the input. Otherwise, a copy of the input is created.

source