From: crouzet Date: Thu, 2 Jul 2020 07:14:22 +0000 (+0200) Subject: integration patch robustesse nb_proc sous windows X-Git-Tag: 5.6.0~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e829f29f8dab8248049b2264104717d06731fb8f;p=tools%2Fsat.git integration patch robustesse nb_proc sous windows --- 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