diff --git a/multiprocessing-context.patch b/multiprocessing-context.patch new file mode 100644 index 0000000..dc8177f --- /dev/null +++ b/multiprocessing-context.patch @@ -0,0 +1,61 @@ +From c59e46a177bf7134dec3a9a374ec75aec4576e31 Mon Sep 17 00:00:00 2001 +From: Stuart Archibald +Date: Thu, 7 Sep 2023 17:03:56 +0100 +Subject: [PATCH] Fix issue with incompatible multiprocessing context in test. + +This fixes an issue highlighted by a patch added to Python 3.11.5 +which identifies if a semaphore created via one multiprocessing +context is in use by another (doing this is essentially a bug). +--- + numba/tests/test_parallel_backend.py | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/numba/tests/test_parallel_backend.py b/numba/tests/test_parallel_backend.py +index b1bee4fa94e..db64b6971e4 100644 +--- a/numba/tests/test_parallel_backend.py ++++ b/numba/tests/test_parallel_backend.py +@@ -819,13 +819,13 @@ def test_par_parent_explicit_mp_fork_par_child(self): + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) +- q = multiprocessing.Queue() ++ ctx = multiprocessing.get_context('fork') ++ q = ctx.Queue() + + # Start OpenMP runtime on parent via parallel function + Z = busy_func(X, Y, q) + + # fork() underneath with no exec, will abort +- ctx = multiprocessing.get_context('fork') + proc = ctx.Process(target = busy_func, args=(X, Y, q)) + proc.start() + proc.join() +@@ -851,12 +851,12 @@ def test_par_parent_mp_spawn_par_child_par_parent(self): + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) +- q = multiprocessing.Queue() ++ ctx = multiprocessing.get_context('spawn') ++ q = ctx.Queue() + + # Start OpenMP runtime and run on parent via parallel function + Z = busy_func(X, Y, q) + procs = [] +- ctx = multiprocessing.get_context('spawn') + for x in range(20): # start a lot to try and get overlap + ## fork() + exec() to run some OpenMP on children + proc = ctx.Process(target = busy_func, args=(X, Y, q)) +@@ -937,11 +937,11 @@ def test_serial_parent_explicit_mp_fork_par_child_then_par_parent(self): + body = """if 1: + X = np.arange(1000000.) + Y = np.arange(1000000.) +- q = multiprocessing.Queue() ++ ctx = multiprocessing.get_context('fork') ++ q = ctx.Queue() + + # this is ok + procs = [] +- ctx = multiprocessing.get_context('fork') + for x in range(10): + # fork() underneath with but no OpenMP in parent, this is ok + proc = ctx.Process(target = busy_func, args=(X, Y, q)) diff --git a/python-numba.changes b/python-numba.changes index 8dd5500..a827487 100644 --- a/python-numba.changes +++ b/python-numba.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Sep 19 12:08:03 UTC 2023 - Markéta Machová + +- Add multiprocessing-context.patch fixing tests for Python 3.11.5 + ------------------------------------------------------------------- Mon Aug 21 19:53:19 UTC 2023 - Ben Greiner diff --git a/python-numba.spec b/python-numba.spec index 21242c7..bdcb232 100644 --- a/python-numba.spec +++ b/python-numba.spec @@ -57,6 +57,8 @@ Source: https://files.pythonhosted.org/packages/source/n/numba/numba-%{v Patch0: numba-pr9105-np1.25.patch # PATCH-FIX-OPENSUSE skip tests failing due to OBS specifics Patch3: skip-failing-tests.patch +# PATCH-FIX-UPSTREAM https://github.com/numba/numba/commit/c59e46a177bf7134dec3a9a374ec75aec4576e31 Fix issue with incompatible multiprocessing context in test. +Patch4: multiprocessing-context.patch BuildRequires: %{python_module devel >= 3.8} BuildRequires: %{python_module numpy-devel >= %{min_numpy_ver} with %python-numpy-devel < %{max_numpy_ver}} BuildRequires: %{python_module pip}