Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
name = "Elemental"
uuid = "902c3f28-d1ec-5e7e-8399-a24c3845ee38"
version = "0.6.0"
version = "0.7.0"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
DistributedArrays = "aaf54ef3-cdf8-58ed-94cc-d582ad619b94"
Elemental_jll = "c2e960f2-a21d-557e-aa36-859d46eed7e8"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"

[compat]
MPI = "0.20"
DistributedArrays = "0.5, 0.6"
Elemental_jll = "0.87"
julia = "1.3"

[extras]
MPIClusterManagers = "e7922434-ae4b-11e9-05c5-9780451d2c66"
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TSVD = "9449cd9e-2762-5aa3-a617-5413e99d722e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "MPIClusterManagers", "Primes", "TSVD", "Random"]
julia = "1.6"
2 changes: 1 addition & 1 deletion src/Elemental.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Elemental

import MPI
using Distributed
using DistributedArrays
using LinearAlgebra
Expand Down Expand Up @@ -41,7 +42,6 @@ function __init__()
end

include("core/types.jl")
include("mpi.jl")
include("core/matrix.jl")
include("core/grid.jl")
include("core/sparsematrix.jl")
Expand Down
6 changes: 3 additions & 3 deletions src/core/distmatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ for (elty, ext) in ((:ElInt, :i),
# end

function comm(A::DistMatrix{$elty})
cm = Ref{ElComm}()
cm = Ref{MPI.API.MPI_Comm}()
ElError(ccall(($(string("ElDistMatrixDistComm_", ext)), libEl), Cuint,
(Ptr{Cvoid}, Ref{ElComm}),
(Ptr{Cvoid}, Ref{MPI.API.MPI_Comm}),
A.obj, cm))
return cm[]
return MPI.Comm(cm[])
end

function get(A::DistMatrix{$elty}, i::Integer, j::Integer)
Expand Down
12 changes: 6 additions & 6 deletions src/core/distmultivec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ for (elty, ext) in ((:ElInt, :i),
return nothing
end

function DistMultiVec(::Type{$elty}, cm::ElComm = MPI.CommWorld[])
function DistMultiVec(::Type{$elty}, cm::MPI.Comm = MPI.COMM_WORLD)
obj = Ref{Ptr{Cvoid}}(C_NULL)
ElError(ccall(($(string("ElDistMultiVecCreate_", ext)), libEl), Cuint,
(Ref{Ptr{Cvoid}}, ElComm),
(Ref{Ptr{Cvoid}}, MPI.API.MPI_Comm),
obj, cm))
A = DistMultiVec{$elty}(obj[])
finalizer(destroy, A)
return A
end

function comm(A::DistMultiVec{$elty})
cm = Ref{ElComm}()
cm = Ref{MPI.API.MPI_Comm}()
ElError(ccall(($(string("ElDistMultiVecComm_", ext)), libEl), Cuint,
(Ptr{Cvoid}, Ref{ElComm}),
(Ptr{Cvoid}, Ref{MPI.API.MPI_Comm}),
A.obj, cm))
return cm[]
return MPI.Comm(cm[])
end

function get(x::DistMultiVec{$elty}, i::Integer = size(x, 1), j::Integer = 1)
Expand Down Expand Up @@ -117,7 +117,7 @@ end

getindex(x::DistMultiVec, i, j) = get(x, i, j)

function similar(::DistMultiVec, ::Type{T}, sz::Dims, cm::ElComm = MPI.CommWorld[]) where {T}
function similar(::DistMultiVec, ::Type{T}, sz::Dims, cm::MPI.Comm = MPI.COMM_WORLD) where {T}
A = DistMultiVec(T, cm)
resize!(A, sz...)
return A
Expand Down
10 changes: 5 additions & 5 deletions src/core/distsparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ for (elty, ext) in ((:ElInt, :i),
return nothing
end

function DistSparseMatrix(::Type{$elty}, comm::ElComm = MPI.CommWorld[])
function DistSparseMatrix(::Type{$elty}, comm::MPI.COMM_WORLD = MPI.COMM_WORLD)
obj = Ref{Ptr{Cvoid}}(C_NULL)
ElError(ccall(($(string("ElDistSparseMatrixCreate_", ext)), libEl), Cuint,
(Ref{Ptr{Cvoid}}, ElComm),
(Ref{Ptr{Cvoid}}, MPI.API.MPI_Comm),
obj, comm))
A = DistSparseMatrix{$elty}(obj[])
finalizer(destroy, A)
return A
end

function comm(A::DistSparseMatrix{$elty})
cm = Ref{ElComm}()
cm = Ref{MPI.API.MPI_Comm}()
ElError(ccall(($(string("ElDistSparseMatrixComm_", ext)), libEl), Cuint,
(Ptr{Cvoid}, Ref{ElComm}),
(Ptr{Cvoid}, Ref{MPI.API.MPI_Comm}),
A.obj, cm))
return cm[]
end
Expand Down Expand Up @@ -112,7 +112,7 @@ for (elty, ext) in ((:ElInt, :i),
end

# The other constructors don't have a version with dimensions. Should they, or should this one go?
function DistSparseMatrix(::Type{T}, m::Integer, n::Integer, comm::ElComm = MPI.CommWorld[]) where {T}
function DistSparseMatrix(::Type{T}, m::Integer, n::Integer, comm::MPI.Comm = MPI.COMM_WORLD) where {T}
A = DistSparseMatrix(T, comm)
resize!(A, m, n)
return A
Expand Down
8 changes: 0 additions & 8 deletions src/core/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ function ElIntType()
end
const ElInt = ElIntType()

function ElCommType()
sameSizeAsInt = Cint[0]
ElError(ccall((:ElMPICommSameSizeAsInteger, libEl), Cuint, (Ptr{Cint},),
sameSizeAsInt))
return sameSizeAsInt[1] == 1 ? Cint : Ptr{Cvoid}
end
const ElComm = ElCommType()

function ElGroupType()
sameSizeAsInt = Cint[0]
ElError(ccall((:ElMPIGroupSameSizeAsInteger, libEl), Cuint, (Ptr{Cint},),
Expand Down
115 changes: 0 additions & 115 deletions src/mpi.jl

This file was deleted.

7 changes: 7 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[deps]
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
MPIClusterManagers = "e7922434-ae4b-11e9-05c5-9780451d2c66"
Primes = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TSVD = "9449cd9e-2762-5aa3-a617-5413e99d722e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"