Workqueue: Numba's Default, Simple Parallel Scheduler

The `workqueue` is Numba's guaranteed-present, simple built-in work-sharing task scheduler, serving as a fallback. However, it is explicitly not thread-safe for nested parallelism and will raise a `SIGABRT` if it detects such usage.

The top 3

  1. Numba's Top 3 Parallel Schedulers: When to Choose Workqueue: Workqueue is Numba's only guaranteed-present, simple built-in parallel scheduler, while `tbb` (Intel TBB) and `omp` (OpenMP) offer advanced, library-backed alternatives for specialized parallel execution.
  2. Workqueue's Core Weakness: No Nested Parallelism: Numba's default Workqueue threading layer is explicitly not thread-safe and detects nested parallel kernel launches, terminating execution with a `SIGABRT` signal, making TBB a recommended alternative for such cases.
  3. Workqueue's Static Scheduling: Performance Trade-offs: By default, Numba's Workqueue scheduler divides parallel region iterations into approximately equally sized chunks, akin to OpenMP's static scheduling, which can lead to load imbalances if work per iteration varies significantly.

Sources

Open the full topic