1D, 2D, and 3D domain decomposition.
Neighbor exchange with arbitrarily sized halo cell regions. Note, this is currently fixed across all dimensions.
Communication is currently handled by MPI.ISend
and MPI.IRecv
underneath, but future versions will give the option for one-sided communication with MPI.Put
and MPI.Get
.
Halo exchange can be orthogonal-only (e.g. [i+1,j,k]
) , or it can include corners as well (e.g [i+1,j+1,k]
)
GPU testing – I don’t currently have a local GPU to test this with, but future work will include GPU-aware MPI
Fix the limitation of 1D, 2D, or 3D arrays. For example, an array U
could have dimensions for [q,i,j]
, but halo exchanges are only done on i
and j
.
Optimization of neighbor communication (caching, etc…)
Finish onesided implementation
Quickstart
using MPI, MPIHaloArrays
MPI.Init()
const comm = MPI.COMM_WORLD
const rank = MPI.Comm_rank(comm)
const nprocs = MPI.Comm_size(comm)
const root = 1
# Create a topology type the facilitates neighbor awareness and global size
topology = CartesianTopology(comm,
[4,2], # domain decompose in a 4x2 grid of ranks
[false, false]) # no periodic boundaries
nhalo = 2
# Create some data on the local rank
local_data = rand(10,20) * rank
A = MPIHaloArray(local_data, topology, nhalo)
fillhalo!(A, -1)
# Perform halo exchange
updatehalo!(A)
# Or start with a large global array
B_global = rand(512,512)
# divide by rank and return B::MPIHaloArray
B_local = scatterglobal(B_global, root, nhalo, topology;
do_corners = false) # if your algorithm doesn't need
# corner info, this will save communication
# do some work
# ....
updatehalo!(B_local)
# do some work
# ....
# and pull it back to the root rank
B_result = gatherglobal(B_local; root=root)
GC.gc()
MPI.Finalize()
2D Diffusion
See in the example here in the github repository.
See the docs here