using DAMASK_NUM_THREADS controls # workers for add_XXX
This commit is contained in:
parent
36c1744a59
commit
065fc9ffde
|
@ -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)
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue