-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add some diagnostics for Parthenon-VIBE #982
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (just some minor comments)
def get_rel_diff(d1, d2): | ||
"Get relative difference between two numpy arrays" | ||
return 2 * np.abs(d1 - d2) / (d1 + d2 + 1e-20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using some of the numpy testing functions instead (which may be helpful wrt to floating point comparisons at different scales)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks cool---I wasn't aware of these. But they all seem to be asserts, whereas I would prefer to print an error message and the location in the array that is off. Is there functionality for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are also the non-testing/assert versions of most of the functionality, e.g., https://numpy.org/doc/stable/reference/generated/numpy.isclose.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this still doesn't quite meet needs I think, as it doesn't easily output this diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yurlungur , looks good. Thx!
@Yurlungur this looks great. Can you add example usage and update the submodule in the LANL benchmarks site? github.com/lanl/benchmarks |
Yes---I'll do that. Thanks for the reminder, @gshipman |
PR Summary
As a way to quickly gut check some measure of correctness, and to highlight the history features of parthenon, I add some tooling to output the total "mean-square mass" of the Burger's variables in Parthenon-VIBE into the history file. I also output the total number of meshblocks at the time of history dump.
This can be compared, up to some tolerance, for various configurations or pieces of hardware by diffing using the
burgers_diff.py
script that I also add.In principle, this could be hooked into a gold file for regression testing, but I think for now this is good enough. It provides some useful machinery for us to use for, e.g., machine acceptance criteria.
PR Checklist