Devin Matthews

Results 264 comments of Devin Matthews

Sorry @jeffhammond I hijacked the PR description to flesh out some ideas related to the larger problem of thread pinning.

@jeffhammond once we're in the OMP region, it's kind of too late to do anything except, as in `bli_l3_thread_decorator_thread_check`, detect that we have only one thread when we expected more...

@jeffhammond can you walk me through the logic of the PR as implemented? I'm not sure how the CPU mask alone can reliably be used to detect oversubscription.

Ah OK, so the user could in principle reduce the number of HW cores "visible" to BLIS by setting a mask but if no action is taken then BLIS just...

@jeffhammond sorry to be dense but I still don't see how this check fixes the oversubscription problem in #588. Each "instance" of BLIS would still pass the check, but the...

> If I set OMP_NUM_THREADS=16 on an Intel CPU with 8 HW threads, it aborts. When I set OMP_NUM_THREADS=8, it's fine. I added a test that can do other things....

Here are my suggested solutions: 1. Maintain a process-wide atomic `int` which counts the number of active threads. Abort (or warn etc.) if this exceeds the number of HW cores....

Also, I suggest an environment variable `BLIS_OVERSUBSCRIBE`. The values `ABORT` and `WARN` would do what you expect and any other value ignores oversubscription. Maybe also a `SERIALIZE` option?

@egaudry @jeffhammond the issue in #588 was explained [here](https://github.com/flame/blis/issues/588#issuecomment-1021385664). How is that not nested OMP?