calc_every != 0 does not properly work during CCTK_EVOL
Opened this issue · 2 comments
rhaas80 commented
Currently Kranc always inserts this fragment (in Kranc/Tools/CodeGen/CodeGenCalculation.m)
ConditionalOnParameterTextual[
"cctk_iteration % " <> functionName <> "_calc_every != " <>
functionName <> "_calc_offset", "return;\n"],
which is however not correct in CCTK_EVOL since there the data that will appear as cctk_iteration = it is cctk_iteration+1. calc_offset does not help since it would have to be 1 for rl>rl_finest and 0 for rl==rk_finest.
As far as I know the only way to fix is to either make the condition dependent on EVOL vs POSTSTEP or to run at every single timestep.
rhaas80 commented
Actually, moving the offset into the computation should do the trick:
ConditionalOnParameterTextual[
"(cctk_iteration - " <> functionName <> "_calc_offset) % " <> functionName <> "_calc_every != 0"
, "return;\n"],
rhaas80 commented
No, that does not work either since it would compute eg for level 2 at iteration 1 (assuming offset is 1) but it would need to compute at iteration 3 for a calc_every of 4.