From 8f5745241611381271d5dde9cb050b109a56023f Mon Sep 17 00:00:00 2001 From: Jonas Heinzmann Date: Wed, 13 Nov 2024 12:06:26 +0100 Subject: [PATCH 1/2] fix minor bug in l8_diffusion_2D_perf_xpu script --- scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl b/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl index 0091789e..b2c4407a 100644 --- a/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl +++ b/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl @@ -13,9 +13,9 @@ using Plots, Printf macro qx(ix, iy) esc(:(-D_dx * (C[$ix+1, $iy+1] - C[$ix, $iy+1]))) end macro qy(ix, iy) esc(:(-D_dy * (C[$ix+1, $iy+1] - C[$ix+1, $iy]))) end -@parallel_indices (ix, iy) function compute!(C2, C, D_dx, D_dy, dt, _dx, _dy, size_C1_2, size_C2_2) +@parallel_indices (ix, iy) function compute!(C2, C, D_dx, D_dy, dt, size_C1_2, size_C2_2) if (ix <= size_C1_2 && iy <= size_C2_2) - C2[ix+1, iy+1] = C[ix+1, iy+1] - dt * ((@qx(ix + 1, iy) - @qx(ix, iy)) * _dx + (@qy(ix, iy + 1) - @qy(ix, iy)) * _dy) + C2[ix+1, iy+1] = C[ix+1, iy+1] - dt * ((@qx(ix + 1, iy) - @qx(ix, iy)) * D_dx + (@qy(ix, iy + 1) - @qy(ix, iy)) * D_dy) end return end @@ -49,7 +49,7 @@ end # Time loop for it = 1:nt if (it == 11) t_tic = Base.time(); niter = 0 end - @parallel compute!(C2, C, D_dx, D_dy, dt, _dx, _dy, size_C1_2, size_C2_2) + @parallel compute!(C2, C, D_dx, D_dy, dt, size_C1_2, size_C2_2) C, C2 = C2, C # pointer swap niter += 1 if do_visu && (it % nout == 0) From c44a8dec271ad661b3dfd5aa6b5b7a5f7f982c73 Mon Sep 17 00:00:00 2001 From: Jonas Heinzmann Date: Wed, 13 Nov 2024 12:11:15 +0100 Subject: [PATCH 2/2] get rid of unnecessary definition in l8_diffusion_2D_perf_xpu script --- scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl b/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl index b2c4407a..ac3beb7e 100644 --- a/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl +++ b/scripts/l8_scripts/l8_diffusion_2D_perf_xpu.jl @@ -35,7 +35,6 @@ end xc, yc = LinRange(dx / 2, Lx - dx / 2, nx), LinRange(dy / 2, Ly - dy / 2, ny) D_dx = D / dx D_dy = D / dy - _dx, _dy = 1.0 / dx, 1.0 / dy # Array initialisation C = Data.Array(exp.(.-(xc .- Lx / 2) .^ 2 .- (yc' .- Ly / 2) .^ 2)) C2 = copy(C)