FEM: Add property to disable PaStiX mixed precision for the ccx solver (#23539)
* FEM: Update solver_calculix.py * FEM: Update solver.py * FEM: Update calculixtools.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * FEM: Update calculixtools.py * FEM: Update task_solver_ccxtools.py * FEM: Update task_solver_ccxtools.py * FEM: Update solver_calculix.py * FEM: Update solver.py * FEM: Update calculixtools.py * FEM: Update task_solver_ccxtools.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -330,6 +330,15 @@ class SolverCalculiX(base_fempythonobject.BaseFemPythonObject):
|
||||
value=False,
|
||||
)
|
||||
)
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyBool",
|
||||
name="PastixMixedPrecision",
|
||||
group="Solver",
|
||||
doc="Mixed precision for the PaStiX matrix solver",
|
||||
value=False,
|
||||
)
|
||||
)
|
||||
return prop
|
||||
|
||||
def onDocumentRestored(self, obj):
|
||||
|
||||
@@ -116,6 +116,8 @@ class CalculiXTools:
|
||||
"AnalysisNumCPUs", QThread.idealThreadCount()
|
||||
)
|
||||
env.insert("OMP_NUM_THREADS", str(num_cpu))
|
||||
pastix_prec = "1" if self.obj.PastixMixedPrecision else "0"
|
||||
env.insert("PASTIX_MIXED_PRECISION", pastix_prec)
|
||||
self.process.setProcessEnvironment(env)
|
||||
self.process.setWorkingDirectory(self.obj.WorkingDirectory)
|
||||
|
||||
|
||||
@@ -433,6 +433,16 @@ class _BaseSolverCalculix:
|
||||
)
|
||||
obj.ExcludeBendingStiffness = False
|
||||
|
||||
if not hasattr(obj, "PastixMixedPrecision"):
|
||||
obj.addProperty(
|
||||
"App::PropertyBool",
|
||||
"PastixMixedPrecision",
|
||||
"Fem",
|
||||
"Mixed precision for the PaStiX matrix solver",
|
||||
locked=True,
|
||||
)
|
||||
obj.PastixMixedPrecision = False
|
||||
|
||||
|
||||
class Proxy(solverbase.Proxy, _BaseSolverCalculix):
|
||||
"""The Fem::FemSolver's Proxy python type, add solver specific properties"""
|
||||
|
||||
@@ -383,6 +383,8 @@ class _TaskPanel:
|
||||
env = QtCore.QProcessEnvironment.systemEnvironment()
|
||||
num_cpu_pref = ccx_prefs.GetInt("AnalysisNumCPUs", QtCore.QThread.idealThreadCount())
|
||||
env.insert("OMP_NUM_THREADS", str(num_cpu_pref))
|
||||
pastix_prec = "1" if self.fea.solver.PastixMixedPrecision else "0"
|
||||
env.insert("PASTIX_MIXED_PRECISION", pastix_prec)
|
||||
self.Calculix.setProcessEnvironment(env)
|
||||
|
||||
self.cwd = QtCore.QDir.currentPath()
|
||||
|
||||
Reference in New Issue
Block a user