-
Notifications
You must be signed in to change notification settings - Fork 66
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
MOM_murmur: MurmurHash3 implementation #834
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.
Thank you for this valuable new contribution. I note about a half-dozen lines that should be modified to conform to the MOM6 style guide that should be changed before this could be accepted.
Also, I find that the name murmur()
is not very self explanatory. Would you consider changing this to murmur_hash()
instead to give a clearer hint of what it is doing?
I renamed I screwed up the rebase and accidentally merged the two commits, but I suppose they sort of belong together anyway. See the inline comments about the array indexing convention. |
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 PR is now looks good to me.
8657817
to
12f0941
Compare
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.
Unfortunately this PR is not compiling with the version of the PGI / NVIDIA compiler we have access to due to non-support of the Fortran 2008 shiftr()
function. (It is compiling and running perfectly well with the intel and gnu compilers.) This PR needs to be changed to compile with all of the compilers we are using for testing, or perhaps we need another strategy for how to handle this valuable new capability so that we can still use it for debugging when we are not using the PGI/NVIDIA compiler.
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.
Thank you for these revisions, which should hopefully work better across a range of compilers.
This patch adds the MOM_murmur_hash module, a non-cryptographic hash function used to generate unique hashes for arrays. The particular property of interest is that murmur hashes are sensitive to order. This will allow us to detect a wider range of answer changes which would otherwise be undetected by the current min/max/mean/bitcount method. The checksum functions have also been modified to produce murmur hashes, although the compile-time flag to generate them is currently disabled.
c673cf8
to
53b4fcf
Compare
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26395. |
This PR adds a new module,
MOM_murmur
, that computes the MurmurHash of an input array. Themurmur
function computes a unique 32-bit hash of an array. Hashes are unique to a particular reordering and can also detect presence of negative zeros. Both cases are currently undetected by current debug tests (mean/min/max/bitcount).Hash checksums are currently disabled, since our testing reports hash differences for a few diagnostics. It can be enabled at compile-time when needed, and we can enable this test at some later date after the offending arrays have been investigated.