Communcation Layer

Communications Layer

JuliaPetra abstracts communication with the Comm and Distributor interfaces. There are two communication implementations with JuliaPetra SerialComm and MPIComm. Note that most objects dependent on inter-process communication support the getComm method.

Interface

JuliaPetra.CommType.

The base type for types that represent communication in parallel computing.

All subtypes must have the following methods, with CommImpl standing in for the subtype:

barrier(comm::CommImpl)

Each processor must wait until all processors have arrived

broadcastAll(comm::CommImpl, myvals::AbstractArray{T}, Root::Integer)::Array{T} where T

Takes a list of input values from the root processor and sends to all other processors. The values are returned (including on the root process)

gatherAll(comm::CommImpl, myVals::AbstractArray{T})::Array{T} where T

Takes a list of input values from all processors and returns an ordered contiguous list of those values on each processor

sumAll(comm::CommImpl, partialsums::AbstractArray{T})::Array{T} where T

Take a list of input values from all processors and returns the sum on each processor. The method +(::T, ::T)::T can be assumed to exist

maxAll(comm::CommImpl, partialmaxes::AbstractArray{T})::Array{T} where T

Takes a list of input values from all processors and returns the max to all processors. The method <(::T, ::T)::Bool can be assumed to exist

minAll(comm::CommImpl, partialmins::AbstractArray{T})::Array{T} where T

Takes a list of input values from all processors and returns the min to all processors. The method <(::T, ::T)::Bool can be assumed to exist

scanSum(comm::CommImpl, myvals::AbstractArray{T})::Array{T} where T

Takes a list of input values from all processors, computes the scan sum and returns it to all processors such that processor i contains the sum of values from processor 1 up to and including processor i. The method +(::T, ::T)::T is used for the addition.

myPid(comm::CommImpl{GID, PID, LID})::PID

Returns the process rank

numProc(comm::CommImpl{GID, PID, LID})::PID

Returns the total number of processes

createDistributor(comm::CommImpl{GID, PID, LID})::Distributor{GID, PID, LID}

Create a distributor object

source

The base type for gather/scatter setup. All subtypes must have the following methods, with DistributorImpl standing in for the subtype:

createFromSends(dist::DistributorImpl,exportPIDs::AbstractArray{PID})::Integer where PID <:Integer

Sets up the Distributor object using a list of process IDs to which we export. Returns the number of IDs this processor will be receiving.

createFromRecvs(dist::DistributorImpl, remoteGIDs::AbstractArray{GID}, remotePIDs::AbstractArray{PID})::Tuple{AbstractArray{GID}, AbstractArray{PID}} where GID <: Integer where PID <: Integer

Sets up the Distributor object using a list of remote global IDs and corresponding PIDs. Returns a tuple with the global IDs and their respective processor IDs being sent by this processor.

resolvePosts(dist::DistributorImpl, exportObjs::AbstractArray)

Post buffer of export objects. Other, local work can be done before resolving the waits. Otherwise, as resolve.

resolveWaits(dist::DistributorImpl)::AbstractArray

Wait on a set of posts

resolveReversePosts(dist::DistributorImpl, exportObjs::AbstractArray)

Do reverse post of buffer of export objects Other, local work can be done before resolving the waits. Otherwise, as resolveReverse.

resolveReverseWaits(dist::DistributorImpl)::AbstractArray

Wait on a set of reverse posts.

source

Functions

JuliaPetra.getCommFunction.
getComm(obj)

Gets the Comm for the object, if applicable

source
JuliaPetra.barrierFunction.
barrier(::Comm)

Causes the process to pause until all processes have called barrier. Used to synchronize the processes

source
broadcastAll(::Comm, myVals::T, root::Integer)::T
broadcastAll(comm::Comm, myVals::AbstractArray{T, 1}, root::Integer)::Array{T, 1}

Takes a list of input values from the root processor and sends it to each other processor. The broadcasted values are then returned, including on the root process.

source
JuliaPetra.gatherAllFunction.
gatherAll(::Comm, myVal::T)::Array{T, 1}
gatherAll(comm::Comm, myVals::AbstractArray{T, 1})::Array{T, 1}

Takes a list of input values from all processors and returns an ordered, contiguous list of those values.

source
JuliaPetra.sumAllFunction.
sumAll(::Comm, partialsum::T)::T
sumAll(comm::Comm, partialsums::AbstractArray{T, 1})::Array{T, 1}

Takes a list of input values from all processors and returns the sum on each processor. The method +(::T, ::T)::T must exist.

source
JuliaPetra.maxAllFunction.
maxAll(::Comm, partialmax::T)::T
maxAll(comm::Comm, partialmaxes::AbstractArray{T, 1})::Array{T, 1}

Takes a list of input values from all processors and returns the max to all processors. The method <(::T, ::T)::Bool must exist.

source
JuliaPetra.minAllFunction.
minAll(::Comm, partialmin::T)::T
minAll(comm::Comm, partialmins::AbstractArray{T, 1})::Array{T, 1}

Takes a list of input values from all processors and returns the min to all processors. The method <(::T, ::T)::Bool must exist.

source
JuliaPetra.scanSumFunction.
scanSum(::Comm, myval::T)::T
scanSum(comm::Comm, myvals::AbstractArray{T, 1})::Array{T, 1}

Takes a list of input values from all processors, computes the scan sum and returns it to all processors such that processor i contains the sum of values from processor 1 up to, and including, processor i. The method +(::T, ::T)::T must exist

source
JuliaPetra.myPidFunction.
myPid(::Comm{GID, PID, LID})::PID

Returns the rank of the calling processor

source
JuliaPetra.numProcFunction.
numProc(::Comm{GID, PID, LID})::PID

Returns the total number of processes

source
createDistributor(comm::Comm{GID, PID, LID})::Distributor{GID, PID, LID}

Creates a distributor for the given Comm object

source
createFromSends(dist::Distributor, exportPIDs::AbstractArray{<:Integer})::Integer

Sets up the Distributor object using a list of process IDs to which we export and the number of IDs being exported. Returns the number of IDs this processor will be receiving

source
createFromRecvs(dist::Distributor{GID, PID, LID}, remoteGIDs::AbstractArray{<:Integer}, remotePIDs::AbstractArray{<:Integer})::Tuple{AbstractArray{GID}, AbstractArray{PID}}

Sets up the Distributor object using a list of remote global IDs and corresponding PIDs. Returns a tuple with the global IDs and their respective processor IDs being sent by me.

source
JuliaPetra.resolveFunction.
resolve(dist::Distributor, exportObjs::AbstractArray{T})::AbstractArray{T}

Execute the current plan on buffer of export objects and return the objects set to this processor

source
resolvePosts(dist::Distributor, exportObjs::AbstractArray)

Post buffer of export objects. Other, local work can be done before resolving the waits. Otherwise, as resolve.

source
resolveWaits(dist::Distributor)::AbstractArray

Wait on a set of posts.

source
resolveReverse(dist::Distributor, exportObjs::AbstractArray{T})::AbstractArray{T}

Execute the reverse of the current plan on buffer of export objects and return the objects set to this processor

source
resolveReversePosts(dist::Distributor, exportObjs::AbstractArray)

Do reverse post of buffer of export objects Other, local work can be done before resolving the waits. Otherwise, as resolveReverse.

source
resolveReverseWaits(dist::Distributor)::AbstractArray

Wait on a set of reverse posts.

source

Implementations

LocalComm(::Comm{GID, PID, LID})

Creates a comm object that creates an error when inter-process communication is attempted, but still allows access to the correct process ID information

source
SerialComm()

Gets an serial communication instance. Serial communication results in mostly no-ops for the communication operations

source
SerialDistributor()

Creates a distributor to work with SerialComm

source
MPIComm()
MPIComm(comm::MPI.Comm)

An implementation of Comm using MPI The no argument constructor uses MPI.COMM_WORLD

source
MPIDistributor{GID, PID, LID}(comm::MPIComm{GID, PID, LID})

Creates an Distributor to work with MPIComm. Created by createDistributor(::MPIComm{GID, PID, LID})

source