Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
sched-simple: fix alloc/free for resource sets with equal size but different cpusets #2203
This PR fixes #2202. The problem was a dumb implementation of an idset comparator internal to
The new implementation detects unequal idsets that have the same "count" and then falls back to comparing the first different stored integer.
This appears to fix the weirdness under Slurm with cpu-affinity:
Problem: The internal idset_cmp implementation compares unequal idsets using their current count, which obviously causes non-equal idsets of the same count to appear equal. This breaks many functions that rely on internal idset comparator. Additionally, sorting idsets by the current count is probably not what we want. Instead change idset_cmp to compare the first unequal integer stored in the set (where the smaller set is considered lesser when its contents match the first N items of a larger set) Fixes #2202
@chu11, actually I had a change of heart on
Sorry, but can you review again? (You had some great finds last time)
I went ahead and squashed just in case the current changes are good and can be merged right away.
@@ Coverage Diff @@ ## master #2203 +/- ## ========================================== - Coverage 80.86% 80.84% -0.03% ========================================== Files 199 199 Lines 31815 31825 +10 ========================================== Hits 25728 25728 - Misses 6087 6097 +10