From 1d9133f24b1486c5e499ba8ca44e5a705ee8fbe9 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Wed, 5 Jan 2022 16:37:24 +0000 Subject: [PATCH] Added options for Apple M1 CPUs and OpenMp --- gprMax/utilities/host_info.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gprMax/utilities/host_info.py b/gprMax/utilities/host_info.py index 70a7d5d7..c2f45dc3 100644 --- a/gprMax/utilities/host_info.py +++ b/gprMax/utilities/host_info.py @@ -187,7 +187,11 @@ def set_omp_threads(nthreads=None): if sys.platform == 'darwin': # Should waiting threads consume CPU power (can drastically effect # performance) - os.environ['OMP_WAIT_POLICY'] = 'ACTIVE' + 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' # Number of threads may be adjusted by the run time environment to best # utilize system resources