Skip to content

Commit

Permalink
Merge pull request #110 from ChevronETC/mpisetindex
Browse files Browse the repository at this point in the history
  • Loading branch information
deckerla authored May 13, 2022
2 parents e29ce74 + 256afb8 commit f6dd212
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Devito.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function Base.fill!(x::DevitoMPIAbstractArray, v)
end


Base.setindex!(x::DevitoMPIAbstractArray{T,N}, v, i) where {T,N} = error("not implemented")
Base.setindex!(x::DevitoMPIAbstractArray{T,N}, v, I::Vararg{Int,N}) where {T,N} = error("not implemented")
Base.IndexStyle(::Type{<:DevitoMPIAbstractArray}) = IndexCartesian()

struct DevitoMPIArray{T,N,A<:AbstractArray{T,N},D} <: DevitoMPIAbstractArray{T,N}
Expand Down
6 changes: 6 additions & 0 deletions test/mpitests_2ranks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,12 @@ end
end
end

@testset "MPI Setindex Not Implemented" begin
grid = Grid(shape=(5,6,7))
f = Devito.Function(name="f", grid=grid)
@test_throws ErrorException("not implemented") data(f)[2,2,2] = 1.0
end

@testset "MPI Getindex for Function n=$n" for n in ( (11,10), (5,4), (7,2), (4,5,6), (2,3,4) )
N = length(n)
rnk = MPI.Comm_rank(MPI.COMM_WORLD)
Expand Down

0 comments on commit f6dd212

Please sign in to comment.