diff --git a/Project.toml b/Project.toml index 01cb3206..0a308a7c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "JustPIC" uuid = "10dc771f-8528-4cd9-9d3b-b21b2e693339" authors = ["Albert De Montserrat "] -version = "0.6.6" +version = "0.6.7" [deps] Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458" @@ -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" diff --git a/ext/JustPICAMDGPUExt.jl b/ext/JustPICAMDGPUExt.jl index 9096b6f4..4f396abd 100644 --- a/ext/JustPICAMDGPUExt.jl +++ b/ext/JustPICAMDGPUExt.jl @@ -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, @@ -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}}, diff --git a/ext/JustPICCUDAExt.jl b/ext/JustPICCUDAExt.jl index feff8510..bd88af81 100644 --- a/ext/JustPICCUDAExt.jl +++ b/ext/JustPICCUDAExt.jl @@ -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, @@ -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, diff --git a/src/CellArrays/ImplicitGlobalGrid.jl b/src/CellArrays/ImplicitGlobalGrid.jl index 75195b22..4510117d 100644 --- a/src/CellArrays/ImplicitGlobalGrid.jl +++ b/src/CellArrays/ImplicitGlobalGrid.jl @@ -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