Unit test fixes - #1089
Conversation
… given in the input file. Add sample regression test (gkylcas 16cfe76398a327fa8617ed162509585f0c6c6f47).
…up. We should make it so that omega_H is only computed if the field evolves. Passive eqn object is clearly not ready as the result is not as expected.
…x2v passive advection reg test. Tried using TS BCs in passive advection but I think there's a memory bug, need to switch to cluster with valgrind.
…oken its use in bc_twistshift. Also, I think there was a bug in find_cell all along, though I don't know if it was ever triggered. Fix this bug, and adjust a tolerance in twistshift to make it work with the recently added epsilon in rect_grid_find_cell. Unit tests pass. There's still an issue with passive advection using TS BCs because the solution quickly becomes NaNs.
… show that the shift at the lower boundary is OK, but the shift at the upper boundary (which -1 times the lower shift) produces NaNs.
… integrals of bc_twistshift, it was causing NaNs in the fig14 scenario. Fix boundary kernel selection in gk_collisionless_passive_flux. Now the passive advection test with TS BCs looks as expected.
…uadratic q has issues near the upper radial boundary. We'll examine this in a unit test setting, and try it with TCV geo.
… delete or simplify this in the future, but it already reproduces the checkerboard pattern seen in the simulation.
…in the shift across a single cell is equal or greater to the length of the domain along y. I tried to add support for this sort of scenario but didn't succeed. I'll try again in the future. For now we must increase resolution along y, reduce shear or increase Ly so this doesn't happen. Add accepted results to CBC unit test.
…n TS BC updater. The previous approach looked in periodic copies of the domain independently for each point, but this could give different periodic copies for 2-4 points that are meant to define a subcell integral, leading to error. So now we look for the correct periodic copy only once (for a given donor-target pair) and pass that to be used for looking for intersections. This fixes some checkerboarding seen in the CBC geo with Nx cells. All other unit tests continue to pass (I had to generate new cbc accepted results, but I confirmed visually that for Nx=32 the difference was machine precision.
…eger. This explains a mysterious shift we were seeing when structures crossed the IMP.
…ew, so we can call it from python.
…nto gk_passive
…ddress, this makes it easier to call it from python. Rename num_cell_ variables in tcv reg tests so that they use Nx like all other reg tests (makes it easier to automate changes to them).
…nless so now we pass the first one.
…resentation changed.
… resolutions to speed up the test. Rename "anal" to "ana" for obvious reasons.
…ation because the unit test computes sometimes ~1e-7 negative values that make it fail.
…summary of which test failed.
… host pointer to data to a device pointer to data was not correct because it was the pointer to host data and not the pointer to device data that was copied. Hence, this make the code fails when the GPU tries to access that data through the address that was copied 😵💫
…(one because of precision adjustment, the other because of unused misallocated array)
manauref
left a comment
There was a problem hiding this comment.
approving, but please check if rescale_ghost_jacf has some associated gkylcas/maxima code, and delete that too
|
we also have to be mindful that GK depends on some code in |
I see that the kernels used are in |
…wrong, 0 everywhere instead of 0,1 and 2.
…h to import the fix
… into gk_unit_test_fix
The version of the code proposed by this PR is passing all unit tests on both CPU and GPU except: |
…n't run at too low a res because of constraints on TS BCs. Increase tolerance in unit test to 1e-8 so it passes on Perlmutter.
…compilers/libraries being used/linked.
We fix a few failing unit tests on CPU and GPU. We also clean unused code in the GK app.
Core fixes (GPU fail)
ctest_array_opscu_array_copy_range_to_range_diff_range_dimwas failing on GPU because the deflated range is not providing the inverted indexer which is needed by the GPU code of this test.ctest_dg_array_maskctest_tensor_field_ops->on_dev.Vlasov fix (GPU fail)
ctest_dg_em_varsWe import the fix present in kitp-hamil-vlasov branch.
gkyl_dg_mu_op_rangein the GPU part of the test were not set correctly (0 everywhere instead of 0,1, and 2 like in the CPU code).GK fixes
ctest_fem_parprojp=2Dirichlet BC case is protected with an assert. We comment this case now for CPU and GPU.ctest_dg_gyrokinetic_kern_tm0was used as a collisionless enum but this corresponds toGKYL_GK_COLLISIONLESS_NONEwhich returns aNULLupdater and fails the test. We now passGKYL_GK_COLLISIONLESS_ES.ctest_gyrokinetic_cross_prim_moms_bgkctest_mom_gyrokineticM2[0] computed = 172.5525 vs expected 172.3291. This seems to be a consequence of the change ofbmagrepresentation. We update the reference values stored inm2Correctline 855.ctest_rescale_ghost_jacfgyrokinetic/ker/inflate_surf.ctest_gk_geometry_tokctest_bc_twistshiftctest_dg_interpolate(Stellarnvccfail)nvccbecause of a wrong memory access when computing the magnetic field amplitude.