Skip to content
Open
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JustPIC"
uuid = "10dc771f-8528-4cd9-9d3b-b21b2e693339"
authors = ["Albert De Montserrat <albertdemontserratnavarro@erdw.ethz.ch>"]
version = "0.6.6"
version = "0.6.7"

[deps]
Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458"
Expand Down Expand Up @@ -31,7 +31,7 @@ CUDA = "5"
CellArrays = "0.3"
CellArraysIndexing = "0.2"
GridGeometryUtils = "0.1"
ImplicitGlobalGrid = "0.16"
ImplicitGlobalGrid = "0.16, 0.17"
JLD2 = "0.5, 0.6"
MPI = "0.20"
MuladdMacro = "0.2.4"
Expand Down
24 changes: 0 additions & 24 deletions ext/JustPICAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,6 @@ module _2D
include(joinpath(@__DIR__, "../src/common.jl"))
include(joinpath(@__DIR__, "../src/AMDGPUExt/CellArrays.jl"))

# halo update
function JustPIC._2D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, ROCArray{T, nD}}, NA}
) where {NA, S, N, D, T, nD}
return update_cell_halo!(x...)
end
function JustPIC._2D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, ROCArray{T, nD, B}}, NA}
) where {NA, S, N, D, T, nD, B}
return update_cell_halo!(x...)
end

# Conversions
function JustPIC._2D.Particles(
coords,
Expand Down Expand Up @@ -743,18 +731,6 @@ module _3D
include(joinpath(@__DIR__, "../src/common.jl"))
include(joinpath(@__DIR__, "../src/AMDGPUExt/CellArrays.jl"))

# halo update
function JustPIC._3D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, ROCArray{T, nD}}, NA}
) where {NA, S, N, D, T, nD}
return update_cell_halo!(x...)
end
function JustPIC._3D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, ROCArray{T, nD, B}}, NA}
) where {NA, S, N, D, T, nD, B}
return update_cell_halo!(x...)
end

function JustPIC._3D.Particles(
coords,
index::CellArray{StaticArraysCore.SVector{N1, Bool}, 3, 0, ROCArray{Bool, N2}},
Expand Down
24 changes: 0 additions & 24 deletions ext/JustPICCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,6 @@ module _2D
include(joinpath(@__DIR__, "../src/common.jl"))
include(joinpath(@__DIR__, "../src/CUDAExt/CellArrays.jl"))

# halo update
function JustPIC._2D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, CuArray{T, nD}}, NA}
) where {NA, S, N, D, T, nD}
return update_cell_halo!(x...)
end
function JustPIC._2D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, CuArray{T, nD, B}}, NA}
) where {NA, S, N, D, T, nD, B}
return update_cell_halo!(x...)
end

# Conversions
function JustPIC._2D.Particles(
coords,
Expand Down Expand Up @@ -731,18 +719,6 @@ module _3D
include(joinpath(@__DIR__, "../src/common.jl"))
include(joinpath(@__DIR__, "../src/CUDAExt/CellArrays.jl"))

# halo update
function JustPIC._3D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, CuArray{T, nD}}, NA}
) where {NA, S, N, D, T, nD}
return update_cell_halo!(x...)
end
function JustPIC._3D.update_cell_halo!(
x::Vararg{CellArray{S, N, D, CuArray{T, nD, B}}, NA}
) where {NA, S, N, D, T, nD, B}
return update_cell_halo!(x...)
end

# Conversions
function JustPIC._3D.Particles(
coords,
Expand Down
52 changes: 26 additions & 26 deletions src/CellArrays/ImplicitGlobalGrid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,35 @@
# particle2grid!(T, pT, particles)
# ```
# """
# function update_cell_halo!(x::Vararg{CellArray, N}) where {N}
# for xᵢ in x
# update_halo!(xᵢ)
# end
# return
# end

function update_cell_halo!(
x::Vararg{CellArray{S, N, D, A}, NA}
) where {NA, S, N, D, A <: AbstractArray}
ni = size(x[1])
tmp = @fill(0.0e0, ni..., eltype = eltype(x[1].data))
function update_cell_halo!(x::Vararg{CellArray, N}) where {N}
for xᵢ in x
for ip in cellaxes(xᵢ)
@parallel (@idx ni) move_CellArray_to_Array!(tmp, xᵢ, ip)
update_halo!(tmp)
@parallel (@idx ni) move_Array_to_CellArray!(xᵢ, tmp, ip)
end
return nothing
update_halo!(xᵢ)
end
return
end

@parallel_indices (I...) function move_Array_to_CellArray!(A::CellArray, B::AbstractArray, ip)
@inbounds @index A[ip, I...] = B[I...]
return nothing
end
# function update_cell_halo!(
# x::Vararg{CellArray{S, N, D, A}, NA}
# ) where {NA, S, N, D, A <: AbstractArray}
# ni = size(x[1])
# tmp = @fill(0.0e0, ni..., eltype = eltype(x[1].data))
# for xᵢ in x
# for ip in cellaxes(xᵢ)
# @parallel (@idx ni) move_CellArray_to_Array!(tmp, xᵢ, ip)
# update_halo!(tmp)
# @parallel (@idx ni) move_Array_to_CellArray!(xᵢ, tmp, ip)
# end
# return nothing
# end
# return
# end

@parallel_indices (I...) function move_CellArray_to_Array!(B::AbstractArray, A::CellArray, ip)
@inbounds B[I...] = @index A[ip, I...]
return nothing
end
# @parallel_indices (I...) function move_Array_to_CellArray!(A::CellArray, B::AbstractArray, ip)
# @inbounds @index A[ip, I...] = B[I...]
# return nothing
# end

# @parallel_indices (I...) function move_CellArray_to_Array!(B::AbstractArray, A::CellArray, ip)
# @inbounds B[I...] = @index A[ip, I...]
# return nothing
# end