-
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
map instead of unordered_map for sparse pool #894
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.
LGTM
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
Cuda CI test seems to be failing here, but it's working when I run on a local cuda machine. @lroberts36 is reporting similar issues. @pgrete is there perhaps something wrong with the CI machine? |
Cuda tests did eventually pass, didn't they? And yes, as I mention on Matrix yesterday the machine is more heavily used. now so it's likely just a fight for resources. |
Yes eventually. Perhaps just needs to be timed for nighttime in the EU |
PR Summary
The sparse pool uses an unordered map. However, sparse ids have an implicit ordering, they are integers after all. While not a bug exactly, the unordered map can mangle the ordering and can produce un-intuitive behavior where a user may request sparse IDs and expect the pool to return an ordered list. This PR changes the map to an ordered one (i.e., a heap) so traversal through it always produces sparse IDs sorted from smallest to largest.
PR Checklist