]> SALOME platform Git repositories - tools/sat.git/commitdiff
Salome HOME
integration patch robustesse nb_proc sous windows
authorcrouzet <nicolas.crouzet@cea.fr>
Thu, 2 Jul 2020 07:14:22 +0000 (09:14 +0200)
committercrouzet <nicolas.crouzet@cea.fr>
Thu, 2 Jul 2020 07:14:22 +0000 (09:14 +0200)
src/architecture.py

index 7ca34e809343d2aff16670b0b4a424dd4b907e91..d0044af8b5c80de9837ec946a966c1f5ff18ea52 100644 (file)
@@ -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