Added options for Apple M1 CPUs and OpenMp

这个提交包含在:
Craig Warren
2022-01-05 16:37:24 +00:00
父节点 6f77535870
当前提交 1d9133f24b

查看文件

@@ -187,6 +187,10 @@ def set_omp_threads(nthreads=None):
if sys.platform == 'darwin': if sys.platform == 'darwin':
# Should waiting threads consume CPU power (can drastically effect # Should waiting threads consume CPU power (can drastically effect
# performance) # performance)
if 'Apple' in config.sim_config.hostinfo['cpuID']:
# https://developer.apple.com/documentation/apple-silicon/tuning-your-code-s-performance-for-apple-silicon
os.environ['OMP_WAIT_POLICY'] = 'PASSIVE'
else:
os.environ['OMP_WAIT_POLICY'] = 'ACTIVE' os.environ['OMP_WAIT_POLICY'] = 'ACTIVE'
# Number of threads may be adjusted by the run time environment to best # Number of threads may be adjusted by the run time environment to best