diff --git a/pcigale/__init__.py b/pcigale/__init__.py index 525fc053f62f1f25ebc76333914de34dc9ab9885..161005ea66907edcb1f6281a54a0c1a94bdda007 100644 --- a/pcigale/__init__.py +++ b/pcigale/__init__.py @@ -3,6 +3,15 @@ # Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt # Author: Yannick Roehlly +import os +# Set environment variables to disable multithreading as users will probably +# want to set the number of cores to the max of their computer. +os.environ["OMP_NUM_THREADS"] = "1" +os.environ["OPENBLAS_NUM_THREADS"] = "1" +os.environ["MKL_NUM_THREADS"] = "1" +os.environ["VECLIB_MAXIMUM_THREADS"] = "1" +os.environ["NUMEXPR_NUM_THREADS"] = "1" + import argparse import multiprocessing as mp import sys diff --git a/pcigale_plots/__init__.py b/pcigale_plots/__init__.py index d17eff7d8682df278a7bd724864c103f192515ce..822d918b5b8540cb0825d4299d951bb860ffab29 100644 --- a/pcigale_plots/__init__.py +++ b/pcigale_plots/__init__.py @@ -6,6 +6,15 @@ # Licensed under the CeCILL-v2 licence - see Licence_CeCILL_V2-en.txt # Author: Yannick Roehlly, Médéric Boquien & Denis Burgarella +import os +# Set environment variables to disable multithreading as users will probably +# want to set the number of cores to the max of their computer. +os.environ["OMP_NUM_THREADS"] = "1" +os.environ["OPENBLAS_NUM_THREADS"] = "1" +os.environ["MKL_NUM_THREADS"] = "1" +os.environ["VECLIB_MAXIMUM_THREADS"] = "1" +os.environ["NUMEXPR_NUM_THREADS"] = "1" + import argparse import sys from os import path