diff --git a/python/damask/dadf5.py b/python/damask/dadf5.py index 67ca1d739..b04e89d3e 100644 --- a/python/damask/dadf5.py +++ b/python/damask/dadf5.py @@ -14,6 +14,7 @@ from . import util from . import version from . import mechanics from . import Orientation +from . import Environment # ------------------------------------------------------------------ class DADF5(): @@ -1030,8 +1031,8 @@ class DADF5(): """Call function with input data + extra arguments, returns results + group.""" args['results'].put({**args['func'](**args['in']),'group':args['group']}) - - N_threads = 1 # ToDo: should be a parameter + env = Environment() + N_threads = int(env.options['DAMASK_NUM_THREADS']) results = Queue(N_threads) pool = util.ThreadPool(N_threads) diff --git a/python/damask/environment.py b/python/damask/environment.py index 2fde2c329..4c9ab762c 100644 --- a/python/damask/environment.py +++ b/python/damask/environment.py @@ -8,7 +8,7 @@ class Environment(): def __init__(self): """Read and provide values of DAMASK configuration.""" self.options = {} - self.get_options() + self.__get_options() def relPath(self,relative = '.'): return os.path.join(self.rootDir(),relative) @@ -16,7 +16,7 @@ class Environment(): def rootDir(self): return os.path.normpath(os.path.join(os.path.realpath(__file__),'../../../')) - def get_options(self): + def __get_options(self): for item in ['DAMASK_NUM_THREADS', 'MSC_ROOT', 'MARC_VERSION',