Skip to content

Commit

Permalink
Profile sweeping
Browse files Browse the repository at this point in the history
  • Loading branch information
guyer committed Nov 20, 2023
1 parent b873c7e commit 6605bd6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions fipy/solvers/petsc/petscKrylovSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def _adaptPreconditionedTolerance(self, L, x, b):
def _adaptNaturalTolerance(self, L, x, b):
return (1., PETSc.KSP.NormType.NATURAL)

@profile
def _solve_(self, L, x, b):
ksp = PETSc.KSP()
ksp.create(L.comm)
Expand Down
1 change: 1 addition & 0 deletions fipy/solvers/pysparse/pysparseSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class PysparseSolver(PysparseMatrixSolver):
.. attention:: This class is abstract. Always create one of its subclasses.
"""

@profile
def _solve_(self, L, x, b):
"""
`_solve_` is only for use by solvers which may use
Expand Down
1 change: 1 addition & 0 deletions fipy/solvers/scipy/scipyKrylovSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def _adaptInitialTolerance(self, L, x, b):
factor = self._residualNorm(L, x, b) / self._rhsNorm(L, x, b)
return (factor, None)

@profile
def _solve_(self, L, x, b):
A = L.matrix
if self.preconditioner is None:
Expand Down
1 change: 1 addition & 0 deletions fipy/solvers/trilinos/trilinosAztecOOSolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def _adaptInitialTolerance(self, L, x, b):
def _adaptSolutionTolerance(self, L, x, b):
return (1., AztecOO.AZ_sol)

@profile
def _solve_(self, L, x, b):

Solver = AztecOO.AztecOO(L, x, b)
Expand Down
1 change: 1 addition & 0 deletions fipy/terms/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def solve(self, var=None, solver=None, boundaryConditions=(), dt=None):

self._log.debug("END solve")

@profile
def sweep(self, var=None, solver=None, boundaryConditions=(), dt=None, underRelaxation=None, residualFn=None, cacheResidual=False, cacheError=False):
r"""
Builds and solves the `Term`'s linear system once. This method
Expand Down

0 comments on commit 6605bd6

Please sign in to comment.