From eb126b16c249116f09ef9e6a738dab4e5211799c Mon Sep 17 00:00:00 2001 From: Farid Yagubbayli Date: Tue, 24 Sep 2024 19:41:11 +0200 Subject: [PATCH] Do not bind process in MacOS --- kwave/options/simulation_execution_options.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kwave/options/simulation_execution_options.py b/kwave/options/simulation_execution_options.py index d689ffd3..702b0789 100644 --- a/kwave/options/simulation_execution_options.py +++ b/kwave/options/simulation_execution_options.py @@ -127,17 +127,22 @@ def system_string(self): sys_sep_str = " & " # set system string to define domain for thread migration - system_string = env_set_str + "OMP_PLACES=cores" + sys_sep_str + system_string = env_set_str + if PLATFORM != "darwin": + system_string += "OMP_PLACES=cores" + sys_sep_str if self.thread_binding is not None: + if PLATFORM == "darwin": + raise ValueError("Thread binding is not supported in MacOS.") # read the parameters and update the system options if self.thread_binding: system_string = system_string + " " + env_set_str + "OMP_PROC_BIND=SPREAD" + sys_sep_str else: system_string = system_string + " " + env_set_str + "OMP_PROC_BIND=CLOSE" + sys_sep_str else: - # set to round-robin over places - system_string = system_string + " " + env_set_str + "OMP_PROC_BIND=SPREAD" + sys_sep_str + if PLATFORM != "darwin": + # set to round-robin over places + system_string = system_string + " " + env_set_str + "OMP_PROC_BIND=SPREAD" + sys_sep_str if self.system_call: system_string = system_string + " " + self.system_call + sys_sep_str