Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calc_every != 0 does not properly work during CCTK_EVOL #139

Open
rhaas80 opened this issue Mar 7, 2017 · 2 comments
Open

calc_every != 0 does not properly work during CCTK_EVOL #139

rhaas80 opened this issue Mar 7, 2017 · 2 comments

Comments

@rhaas80
Copy link
Collaborator

rhaas80 commented Mar 7, 2017

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
Copy link
Collaborator Author

rhaas80 commented Mar 7, 2017

Actually, moving the offset into the computation should do the trick:

ConditionalOnParameterTextual[
  "(cctk_iteration - " <> functionName <> "_calc_offset) % " <> functionName <> "_calc_every != 0"
  , "return;\n"],

@rhaas80
Copy link
Collaborator Author

rhaas80 commented Aug 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant