From 0950d4de8aea16696ab87a53dd9c9846f361dd5f Mon Sep 17 00:00:00 2001 From: Neil Lindquist Date: Mon, 8 Apr 2019 12:18:17 -0500 Subject: [PATCH] Add getComm method to Distributors Additionally, there is a minor documentation correction for the `Distributor` interface --- src/Distributor.jl | 5 ++--- src/MPIDistributor.jl | 5 +++++ src/RowMatrix.jl | 2 -- src/SerialComm.jl | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Distributor.jl b/src/Distributor.jl index 8b8d250..473d15e 100644 --- a/src/Distributor.jl +++ b/src/Distributor.jl @@ -14,8 +14,7 @@ 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 and the number of IDs being exported. Returns the number of -IDs this processor will be receiving. +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 @@ -72,7 +71,7 @@ objects set to this processor """ function resolve(dist::Distributor, exportObjs::AbstractArray{T})::AbstractArray{T} where T resolvePosts(dist, exportObjs) - resolveWaits(dist) + resolveWaits(dist)::AbstractArray{T} end """ diff --git a/src/MPIDistributor.jl b/src/MPIDistributor.jl index 647d6e3..dc918f0 100644 --- a/src/MPIDistributor.jl +++ b/src/MPIDistributor.jl @@ -341,6 +341,11 @@ function createReverseDistributor(dist::MPIDistributor{GID, PID, LID} end + +#### General Interface #### + +getComm(dist::MPIDistributor) = dist.comm + #### Distributor interface #### function createFromSends(dist::MPIDistributor{GID, PID, LID}, exportPIDs::AbstractArray{PID, 1})::Integer where GID <:Integer where PID <:Integer where LID <:Integer diff --git a/src/RowMatrix.jl b/src/RowMatrix.jl index a0f0539..80aa790 100644 --- a/src/RowMatrix.jl +++ b/src/RowMatrix.jl @@ -65,8 +65,6 @@ Additionally, Julia's `mul!` and `*` functions are implemented for `RowMatrix`-` abstract type RowMatrix{Data <: Number, GID <: Integer, PID <: Integer, LID <: Integer} <: AbstractArray{Data, 2} end -#REVIEW look into requiring A_mul_B! instead and having apply! call that - isFillActive(matrix::RowMatrix) = !isFillComplete(matrix) isLocallyIndexed(matrix::RowMatrix) = !isGloballyIndexed(matrix) diff --git a/src/SerialComm.jl b/src/SerialComm.jl index 0cc3a9d..a093e84 100644 --- a/src/SerialComm.jl +++ b/src/SerialComm.jl @@ -130,3 +130,5 @@ end function createDistributor(comm::SerialComm{GID, PID, LID})::SerialDistributor{GID, PID, LID} where GID <: Integer where PID <: Integer where LID <: Integer SerialDistributor{GID, PID, LID}() end + +getComm(::SerialDistributor{GID, PID, LID}) where {GID, PID, LID} = SerialComm{GID, PID, LID}()