Skip to content

Commit 073ef8a

Browse files
authored
Merge pull request #8566 from stuartarchibald/fix/8563
Update workqueue abort message on concurrent access.
2 parents 599c95e + 17131e0 commit 073ef8a

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎numba/np/ufunc/workqueue.c‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,17 @@ parallel_for(void *fn, char **args, size_t *dimensions, size_t *steps, void *dat
375375
// check the nesting level, if it's already 1, abort, workqueue cannot
376376
// handle nesting.
377377
if (_nesting_level >= 1){
378-
fprintf(stderr, "%s", "Terminating: Nested parallel kernel launch "
379-
"detected, the workqueue threading layer does "
380-
"not supported nested parallelism. Try the TBB "
381-
"threading layer.\n");
378+
fprintf(stderr, "%s", "Numba workqueue threading layer is terminating: "
379+
"Concurrent access has been detected.\n\n"
380+
" - The workqueue threading layer is not "
381+
"threadsafe and may not be accessed concurrently "
382+
"by multiple threads. Concurrent access "
383+
"typically occurs through a nested parallel "
384+
"region launch or by calling Numba parallel=True "
385+
"functions from multiple Python threads.\n"
386+
" - Try using the TBB threading layer as an "
387+
"alternative, as it is, itself, threadsafe. "
388+
"Docs: https://numba.readthedocs.io/en/stable/user/threading-layer.html\n\n");
382389
raise(SIGABRT);
383390
return;
384391
}

‎numba/tests/test_parallel_backend.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,9 @@ def main():
687687
self.assertIn("failed with code", e_msg)
688688
# raised a SIGABRT, but the value is platform specific so just check
689689
# the error message
690-
self.assertIn("Terminating: Nested parallel kernel launch detected",
691-
e_msg)
690+
expected = ("Numba workqueue threading layer is terminating: "
691+
"Concurrent access has been detected.")
692+
self.assertIn(expected, e_msg)
692693

693694
@unittest.skipUnless(_HAVE_OS_FORK, "Test needs fork(2)")
694695
def test_workqueue_handles_fork_from_non_main_thread(self):

0 commit comments

Comments
 (0)