[FEM] [skip CI] inform user about used CPU cores for Elmer

Since the number of used cores can for Elmer have the impact that a solver run converges or not, output this info prominently
This commit is contained in:
Uwe
2022-07-16 19:46:46 +02:00
parent c4416e00ca
commit 7346ee4073
2 changed files with 6 additions and 1 deletions

View File

@@ -76,6 +76,9 @@ class Prepare(run.Prepare):
def run(self):
# TODO print working dir to report console
self.pushStatus("Preparing input files...\n")
num_cores = settings.get_cores("ElmerGrid")
self.pushStatus("Number of CPU cores to be used for the solver run: {}\n"
.format(num_cores))
if self.testmode:
# test mode: neither gmsh, nor elmergrid nor elmersolver binaries needed
FreeCAD.Console.PrintMessage("Machine testmode: {}\n".format(self.testmode))
@@ -124,6 +127,8 @@ class Solve(run.Solve):
os.environ["LD_LIBRARY_PATH"] = "$LD_LIBRARY_PATH:{}/modules".format(solvpath)
# different call depending if with multithreading or not
num_cores = settings.get_cores("ElmerSolver")
self.pushStatus("Number of CPU cores to be used for the solver run: {}\n"
.format(num_cores))
args = []
if int(num_cores) > 1:
if system() != "Windows":

View File

@@ -114,7 +114,7 @@ def get_cores(name):
if name in _SOLVER_PARAM:
cores = _SOLVER_PARAM[name].get_cores()
FreeCAD.Console.PrintMessage(
"Number of CPU cores to be used for the solver run: {} \n"
"Number of CPU cores to be used for the solver run: {}\n"
.format(cores)
)
return cores