FEM: use new pref for manually set num processor cores in ccx run
This commit is contained in:
parent
414b2b0ffa
commit
1b8e56378a
|
@ -153,8 +153,13 @@ class FemToolsCcx(FemTools.FemTools):
|
||||||
self.ccx_stderr = ""
|
self.ccx_stderr = ""
|
||||||
if self.inp_file_name != "" and self.ccx_binary_present:
|
if self.inp_file_name != "" and self.ccx_binary_present:
|
||||||
ont_backup = os.environ.get('OMP_NUM_THREADS')
|
ont_backup = os.environ.get('OMP_NUM_THREADS')
|
||||||
|
self.ccx_prefs = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Fem/Ccx")
|
||||||
|
num_cpu_pref = self.ccx_prefs.GetInt("AnalysisNumCPUs", 1) # If number of CPU's specified
|
||||||
if not ont_backup:
|
if not ont_backup:
|
||||||
ont_backup = ""
|
ont_backup = str(num_cpu_pref)
|
||||||
|
if num_cpu_pref > 1:
|
||||||
|
_env = os.putenv('OMP_NUM_THREADS', str(num_cpu_pref)) # if user picked a number use that instead
|
||||||
|
else:
|
||||||
_env = os.putenv('OMP_NUM_THREADS', str(multiprocessing.cpu_count()))
|
_env = os.putenv('OMP_NUM_THREADS', str(multiprocessing.cpu_count()))
|
||||||
# change cwd because ccx may crash if directory has no write permission
|
# change cwd because ccx may crash if directory has no write permission
|
||||||
# there is also a limit of the length of file names so jump to the document directory
|
# there is also a limit of the length of file names so jump to the document directory
|
||||||
|
|
Loading…
Reference in New Issue
Block a user