-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
simulations get stuck #1919
Comments
I observed simulations being stuck for far too long time: should have been a week (according to my extrapolation), and I killed the jobs after two months. Trying the above fix revealed that mkl was not installed on the target system. I have no clue yet what may have caused the problem. |
Is there a remote possibility that while Python |
Thanks to @petrposik who sent another related link to the twitter account of Jeremy Howard: |
Proposal: def set_num_threads(nt=1, disp=1):
"""see https://github.com/numbbo/coco/issues/1919
and https://twitter.com/jeremyphoward/status/1185044752753815552
"""
try: import mkl
except ImportError: disp and print("mkl is not installed")
else:
mkl.set_num_threads(nt)
nt = str(nt)
for name in ['OPENBLAS_NUM_THREADS',
'NUMEXPR_NUM_THREADS',
'OMP_NUM_THREADS',
'MKL_NUM_THREADS']:
os.environ[name] = nt
disp and print("setting mkl threads num to", nt)
if sys.platform.lower() not in ('darwin', 'windows'):
set_num_threads(1) will be added to |
I have received several reports by word of mouth that simulations get stuck in that they consume 100% CPU time but cease to write output.
One reason for this behavior can be
numpy
s multithreading, see here. In this case, a simple solution is to executebefore
numpy
or any module that importsnumpy
was imported in Python.However, this seems not to be the only reason for simulations getting stuck. It would be in particular helpful now to know more about such problems which are not due to Python
mkl
.The text was updated successfully, but these errors were encountered: