From c3a3a455f1d484c9529e9fa7317f11278caa3f0d Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Tue, 28 Feb 2017 13:23:13 +0000 Subject: [PATCH] Add workaround for bug with Windows Subsystem for Linux, by setting KMP_AFFINITY to disabled when detected. --- gprMax/input_cmds_singleuse.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gprMax/input_cmds_singleuse.py b/gprMax/input_cmds_singleuse.py index 3c21b4d8..59314ffd 100644 --- a/gprMax/input_cmds_singleuse.py +++ b/gprMax/input_cmds_singleuse.py @@ -71,6 +71,10 @@ def process_singlecmds(singlecmds, G): os.environ['OMP_PROC_BIND'] = 'spread' # Bind threads to physical cores # os.environ['OMP_DISPLAY_ENV'] = 'TRUE' # Prints OMP version and environment variables (useful for debug) + # Catch bug with Windows Subsystem for Linux (https://github.com/gprMax/gprMax/issues/95) + if 'Microsoft' in hostinfo['osversion']: + os.environ['KMP_AFFINITY'] = 'disabled' + if singlecmds[cmd] != 'None': tmp = tuple(int(x) for x in singlecmds[cmd].split()) if len(tmp) != 1: