Conversation
Opt-Mucca
left a comment
There was a problem hiding this comment.
I like the change! I'd defer to @mathgeekcoder for a more informed opinion though
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## latest #3137 +/- ##
=======================================
Coverage 73.18% 73.19%
=======================================
Files 430 430
Lines 104132 104180 +48
Branches 16737 16742 +5
=======================================
+ Hits 76212 76254 +42
- Misses 27644 27650 +6
Partials 276 276 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I think this is great! My only feedback would be to be careful about interchanging the terminology vthreads with cores. Specifically, The On that note, I believe the current (and previous) code assumes 2 vthreads per core, however this is not always true; and gets more complicated when running in the cloud. Ideally, we'd like to get the count of physical cores that we are mapped and masked by affinity, and use this as our number of threads in the thread pool. |
Thank you, @mathgeekcoder! I tried to change the code according to your comments. I hope I did not introduce new bugs, it would be great if you could check. |
|
Oh wow! I said it, but didn't expect you to implement it :) I think this is a great start. If I'm being really pedantic:
But as I said... pedantic. Honestly, it's fine as is! Ultimately, it would be fantastic to also exploit numa nodes and shared cache (e.g., L3). Once @galabovaa gets back we should check if it's okay to use something like hwloc to get this information. hwloc also has cross-platform code to count the cores. For example, it'd be great to configure work-stealing to prefer cores within same numa node, and perhaps use logical processors (i.e., vthread, if available) to sync/exchange information. |
Thanks again, @mathgeekcoder! I tried to address your comments. For Windows, I am trying to follow |
This is a first attempt to handle processor affinity. I am not an expert here, so any feedback is appreciated.