Skip to content

Attach adjoint LinearSolver/Nonlinearsolver objects to original solver class. - #77

Draft
jorgensd wants to merge 7 commits into
mainfrom
dokken/reuse-solvers
Draft

Attach adjoint LinearSolver/Nonlinearsolver objects to original solver class. #77
jorgensd wants to merge 7 commits into
mainfrom
dokken/reuse-solvers

Conversation

@jorgensd

Copy link
Copy Markdown
Member

In the current version of the code, we associate a new SolverBlock (which includes a forward solver, adjoint solver and tlm solver) with each subsequent call to problem.solve().
This is horrible for many reasons, including:

  • Memory overhead of reinitiating solvers/matrices/vectors
  • Repeat compilation of forms that stay constant.

The current implementation, which was initially based on legacy DOLFIN-adjoint did all of these things lazy, and threw away solvers at random points. With later versions of PETSc the Python garbage collector and PETSc GB can start fighting causing deadlocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant