This PR saves the derefinement count for each meshblock and the deallocation count for each sparse variable in the restart output (as well as in regular HDF5 output). This should ensure that restarted simulations give bitwise exact results to simulations that were run from start to finish.
Previously, AMR simulations that were restarted had the deallocation count of all meshblocks reset to zero. This meant that after restart, a block could be deallocated a few steps after it would have been deallocated if there was no restart. This resulted in differences in simulation results with and without restarts many orders of magnitude larger than machine precision, although still relatively small compared to characteristic scales of the problem. An example of this difference is in issue #1072 (the problem detailed there is fixed by this PR).
Similarly, the deallocation count of sparse variables was not stored and was reset to zero on restart. This was a known issue, and the restart regression test set the global deallocation count large enough that variables were never deallocated. This PR also stores the deallocation count of variables in the restart file and sets them to the correct values on restart. The restart test now works with a deallocation count of 5.
Also, MeshRefinement::DereferenceCount is renamed to MeshRefinement::DeallocationCount since dereference count doesn't really make sense.
WARNING: This PR does not solve the edge case described in issue #1077
PR Checklist
[x] Code passes cpplint
[x] Adds a test for any bugs fixed.
[x] Code is formatted
[x] Changes are summarized in CHANGELOG.md
[x] CI has been triggered on Darwin for performance regression tests.
[x] Docs build
[x] (@lanl.gov employees) Update copyright on changed files
PR Summary
This PR saves the derefinement count for each meshblock and the deallocation count for each sparse variable in the restart output (as well as in regular HDF5 output). This should ensure that restarted simulations give bitwise exact results to simulations that were run from start to finish.
Previously, AMR simulations that were restarted had the deallocation count of all meshblocks reset to zero. This meant that after restart, a block could be deallocated a few steps after it would have been deallocated if there was no restart. This resulted in differences in simulation results with and without restarts many orders of magnitude larger than machine precision, although still relatively small compared to characteristic scales of the problem. An example of this difference is in issue #1072 (the problem detailed there is fixed by this PR).
Similarly, the deallocation count of sparse variables was not stored and was reset to zero on restart. This was a known issue, and the restart regression test set the global deallocation count large enough that variables were never deallocated. This PR also stores the deallocation count of variables in the restart file and sets them to the correct values on restart. The restart test now works with a deallocation count of 5.
Also,
MeshRefinement::DereferenceCount
is renamed toMeshRefinement::DeallocationCount
since dereference count doesn't really make sense.WARNING: This PR does not solve the edge case described in issue #1077
PR Checklist