Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement of PETSc interface to support additional options #345

Open
1 task done
dcodoni opened this issue Feb 11, 2025 · 1 comment
Open
1 task done

Improvement of PETSc interface to support additional options #345

dcodoni opened this issue Feb 11, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dcodoni
Copy link
Contributor

dcodoni commented Feb 11, 2025

Problem

The current PETSc implementation involves two types of preconditioners RCS and the Jacobi (a simple diagonal scaling). PETSc offers a vast variety of solvers and preconditioners from different libraries, suitable for a very wide range of problems.

Simple preconditioners such as Jacobi or Block-Jacobi do not require any parameters to be set, but others such as multigrid preconditioners are more complex and default parameters are not optimal.

To use PETSc in an optimal way the users should be able to select preconditioners and set parameters. PETSc allows the user to control all aspects of the linear solvers through options that are given by command line or by a file. This feature is not used in svMultiphyiscs, where solvers and preconditioners (together with tolerances) are set inthe xml input file. As the preconditioning techniques become complicated the amount of parameters to include in the xml file would be not ideal and all the parameters will have to be coded in the solver.

Solution

I identified three possible solutions depending on the direction we want to take:

  1. Keep the structure of svMultiphysics as it is now and manage the preconditioners and parameters internally setting some optimal values for them which the user will not have access to through the xml file. This is similar to the current Trilinos implementation.

CONS: It will be difficult to explore alternatives, and customize preconditioners to the problem we are solving.

  1. Use a PETSc options file that can be used to control every aspect of the linear solver including tolerances, precodntioners type, parameters and so on. We could document all the prefixes and what they refer to.

CONS: An additional input file is needed. Not exactly user friendly since some parameters are not straightforward to understand unless the user has a quite a deep knowledge of the preconditioners.

  1. Hybrid solution where we support the most useful precodntioners with some parameters that are optimal for particular cases but also support using an options file

Additional context

An example is the SCR (Schur Complement Reduction) preconditoners technique. The whole procedure requires to solve 3 linear systems, preconditoned with Algebraic Multi Grid (AMG). Each linear solve requires its own tolerances and other parameters. With optimal selection of preconditioners and parameters using the SCR precondtioner speeds up an FSI simulation with respect to GMRES with a diagonal preconditioner from the FSILS implementation.

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines
@dcodoni dcodoni added the enhancement New feature or request label Feb 11, 2025
@ktbolt ktbolt changed the title Improvement of PETSc implementation Improvement of PETSc interface to support additional options Feb 12, 2025
@ktbolt
Copy link
Collaborator

ktbolt commented Feb 12, 2025

Very few users and really most of the SV Team do not have the expertise to select and choose the optimal parameters needed to improve the performance of a simulation.

But we do want to be able to add new preconditioners that prove to be useful and that are perhaps needed for new applications like G&R.

Thus I think solution (3) a hybrid approach would be best. The tricky bit is designing a framework to support this

  • Hiding details from the user
  • How to store PETSc parameters (e.g. if these are in files then where are those files stored)
  • How to cleanly add a new preconidtioner and its parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants