From c8b87c316c37b014ce0dfbf2a538515475d64c76 Mon Sep 17 00:00:00 2001 From: manuelgloeckler <38903899+manuelgloeckler@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:48:36 +0200 Subject: [PATCH] multiprocessing only with num_cores (#1117) * multiprocessing only with num_cores * revert to what @baschdl suggested * update comment * remove comment --- tests/multiprocessing_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/multiprocessing_test.py b/tests/multiprocessing_test.py index fc2a02317..e53a271a2 100644 --- a/tests/multiprocessing_test.py +++ b/tests/multiprocessing_test.py @@ -26,7 +26,7 @@ def slow_linear_gaussian(theta): @pytest.mark.slow -@pytest.mark.parametrize("num_workers", [10, -2]) +@pytest.mark.parametrize("num_workers", [2]) @pytest.mark.parametrize("sim_batch_size", ((1, 10, 100))) def test_benchmarking_parallel_simulation(sim_batch_size, num_workers): """Test whether joblib is faster than serial processing.""" @@ -54,5 +54,5 @@ def test_benchmarking_parallel_simulation(sim_batch_size, num_workers): ) toc_joblib = time.time() - tic - # Allow joblib to be 10 percent slower due to overhead. - assert toc_joblib <= toc_sp * 1.1 + # Allow joblib to be 50 percent slower due to overhead. + assert toc_joblib <= toc_sp * 1.5