From e829f29f8dab8248049b2264104717d06731fb8f Mon Sep 17 00:00:00 2001 From: crouzet Date: Thu, 2 Jul 2020 09:14:22 +0200 Subject: [PATCH] integration patch robustesse nb_proc sous windows --- src/architecture.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/architecture.py b/src/architecture.py index 7ca34e8..d0044af 100644 --- a/src/architecture.py +++ b/src/architecture.py @@ -144,5 +144,11 @@ def get_nb_proc(): import multiprocessing nb_proc=multiprocessing.cpu_count() except : - nb_proc=int(os.sysconf('SC_NPROCESSORS_ONLN')) + if is_windows(): + if os.environ.has_key("NUMBER_OF_PROCESSORS"): + nb_proc = int(os.environ["NUMBER_OF_PROCESSORS"]) + else: + nb_proc = 1 + else: + nb_proc=int(os.sysconf('SC_NPROCESSORS_ONLN')) return nb_proc -- 2.39.2