From 9503adb6660010f132f5574a4d0233aff067367d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 30 Sep 2022 13:09:56 +0200 Subject: [PATCH] python3Packages.scipy: Limit OpenMP threads during check phase The scipy tests already run in parallel and the openmp threads come on top of that. That overloads machines very easily and therefore we introduce a scaling limit to the number of openmp threads used. https://www.openmp.org/spec-html/5.0/openmpse50.html --- pkgs/development/python-modules/scipy/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index aa578d21d257..e791454b9018 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -54,6 +54,7 @@ buildPythonPackage rec { checkPhase = '' runHook preCheck pushd "$out" + export OMP_NUM_THREADS=$(( $NIX_BUILD_CORES / 4 )) ${python.interpreter} -c "import scipy; scipy.test('fast', verbose=10, parallel=$NIX_BUILD_CORES)" popd runHook postCheck