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
Logic error in ActionWarehouse set intersection #9390
Comments
Broken in 01352b4 |
I worked with Roy on this and approved the change. It's not an easy fix. The problem (as the original PR states) is that MOOSE relies heavily on order despite the fact that it shouldn't anywhere where it's not explicitly declared. The old behavior created all sorts of nasty behavior with DistributedMesh that was not easy to track down. As we move forward it appears that we may need to rely on implicit ordering for a long time. I suggest that we rename the method to make it more clear as to what's occurring here. We can't go back to using sets anytime soon. |
BTW - If there's a compiler flag to enable extra checks in debug clang, I'd be very interested in adding them. GCC still reins king of debug container checking. |
The obvious fix would be to copy the returned vectors into sets inside the for loop and use those in the intersection. |
Right, but you may not realize you aren't getting |
Looking at the code
we need to go deeper. getSortedValuesSets() actually pretends(?) to return a sorted vector. That function is a beast (@bwspenc , did you write this?). I wonder if it contains a small logic error. It surprises me that this makes only one single (new) test fail. |
No I originally wrote this code. I started from stack overflow and then modified it to work with MOOSE. It's been touched by Ben and Roy and many others over the years. |
with
Every. Single. Test. Fails. |
Yeah, ordered as in ordered by dependencies, not "ordered" from a "sorted" point of view. The current design is that it's a "stable ordering" meaning that all items remain in their original order unless an explicit dependency is added. |
Looks like nothing is going to happen here. |
Description of the enhancement or error report
ActionWarehouse uses
std::set_intersection
, wher one of the arguments istask_set
defined byThe fact that
getSortedTaskSet()
returns anstd::vector<std::vector<std::string>>
is obfuscated by theauto
keywords and the fact that the method name is a blatant lie!std::set_intersection
requires the ranges defined by the two iterator sets to be ordered. GCC actually check this now in debug mode, causing @tonkmr's #9379 to fail (https://www.moosebuild.org/job/96999/).Rationale for the enhancement or information for reproducing the error
Broken code.
Identified impact
Fix bug.
The text was updated successfully, but these errors were encountered: