Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion deepmd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,20 @@ def set_mkl():
check whether the numpy is built by mkl, see
https://github.com/numpy/numpy/issues/14751
"""
if "mkl_rt" in np.__config__.get_info("blas_mkl_info").get("libraries", []):
try:
is_mkl = (
np.show_config("dicts")
.get("Build Dependencies", {})
.get("blas", {})
.get("name", "")
.lower()
.startswith("mkl")
)
except TypeError:
is_mkl = "mkl_rt" in np.__config__.get_info("blas_mkl_info").get(
"libraries", []
)
if is_mkl:
set_env_if_empty("KMP_BLOCKTIME", "0")
set_env_if_empty("KMP_AFFINITY", "granularity=fine,verbose,compact,1,0")
reload(np)
Expand Down