Skip to content

Commit

Permalink
Merge pull request #23 from JuliaGeodynamics/adm-bugfix
Browse files Browse the repository at this point in the history
Fix minor indexing bug
  • Loading branch information
albert-de-montserrat authored Nov 22, 2023
2 parents 67de278 + 41d5a4f commit 19e5c71
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
4 changes: 1 addition & 3 deletions scripts/single_particle_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ using JustPIC
using CellArrays
using ParallelStencil
using GLMakie
@init_parallel_stencil(CUDA, Float64, 2)

const TA = backend == "CUDA" ? JustPIC.CUDA.CuArray : Array
@init_parallel_stencil(Threads, Float64, 2)

function init_particle(nxcell, max_xcell, min_xcell, x, y, dx, dy, nx, ny)
ni = nx, ny
Expand Down
4 changes: 1 addition & 3 deletions scripts/single_particle_advection_MPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ using JustPIC
using CellArrays
using ParallelStencil
using GLMakie
@init_parallel_stencil(CUDA, Float64, 2)

const TA = backend == "CUDA" ? JustPIC.CUDA.CuArray : Array
@init_parallel_stencil(Threads, Float64, 2)

function init_particle(nxcell, max_xcell, min_xcell, x, y, dx, dy, nx, ny, me)
ni = nx, ny
Expand Down
5 changes: 1 addition & 4 deletions scripts/temperature_advection.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using JustPIC
using AMDGPU

AMDGPU.allowscalar(false)

# set_backend("AMDGPU_Float64_2D") # need to restart session if this changes

using CellArrays
using ParallelStencil
using CairoMakie
@init_parallel_stencil(AMDGPU, Float64, 2)
@init_parallel_stencil(Threads, Float64, 2)

function init_particles(nxcell, max_xcell, min_xcell, x, y, dx, dy, nx, ny)
ni = nx, ny
Expand Down
2 changes: 1 addition & 1 deletion scripts/temperature_advection3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import JustPIC: @idx, @cell
using CellArrays
using ParallelStencil
using GLMakie
@init_parallel_stencil(CUDA, Float64, 3)
@init_parallel_stencil(Threads, Float64, 3)

function init_particles(nxcell, max_xcell, min_xcell, x, y, z, dx, dy, dz, ni)
ncells = prod(ni)
Expand Down
4 changes: 2 additions & 2 deletions src/Interpolations/particle_to_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function particle2grid!(F, Fp, xi::NTuple, particle_coords)
end

function particle2grid!(F, Fp, xi::NTuple, particle_coords, dxi)
@parallel (@idx size(particle_coords[1])) particle2grid!(
@parallel (@idx size(F)) particle2grid!(
F, Fp, xi, particle_coords, dxi
)
return nothing
Expand Down Expand Up @@ -54,7 +54,7 @@ end
F::NTuple{N,T1}, Fp::NTuple{N,T2}, inode, jnode, xi::NTuple{2,T3}, p, di
) where {N,T1,T2,T3}
px, py = p # particle coordinates
nx, ny = size(F)
nx, ny = size(F[1])
xvertex = xi[1][inode], xi[2][jnode] # cell lower-left coordinates
ω, ωxF = 0.0, 0.0 # init weights

Expand Down

2 comments on commit 19e5c71

@albert-de-montserrat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/98194

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 19e5c71104482fa5b6ddac02f4ee0d39340c4974
git push origin v0.1.0

Please sign in to comment.