parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
112 stars 33 forks source link

Set the correct root level on restart #1053

Closed lroberts36 closed 5 months ago

lroberts36 commented 5 months ago

PR Summary

Currently, on restart Mesh::root_level and Mesh::current_level get set to levels relative to the legacy tree, which is incorrect (see issue #1051). This PR fixes the issue.

PR Checklist

pgrete commented 5 months ago

Also what worries me is that we didn't catch this with the regression tests (particularly as current develop segfaults on restart with the advection example...). Did this just pass by chance?

lroberts36 commented 5 months ago

@pgrete: GetLegacyRootLevel for output is correct for as long as we are outputting legacy locations. This PR just ignores that value on restart and gets the new root level from the forest when it is rebuilt.

I am a little surprised develop segfaulted for restarts. When I was working on the forest PR, I tested restarting sparse advection with non-trivial forests and it seemed to work. That being said, I agree we might need to make the restart test more robust.