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
PETSc object is in wrong state #13100
Comments
As the BoomerAMG preconditioner provided through PETSc and used in Step-40 relies on the package hypre (in fact, the |
Switching between |
Yes. PETSc has a different mental model than we do. Their view is that you should be able to switch solvers and preconditioners based on command line arguments, whereas in deal.II we represent these as fixed types that are chosen at compile time (because that's how we do things with deal.II's own solvers and preconditioners, as well as those we import from Trilinos or other external libraries). I have never tried to set PETSc details on the command line, but it does not surprise me that that leads to trouble. |
Even if I replace:
by:
and not toy around with |
I certainly have no idea what is going wrong here, and the PETSc error message isn't helpful either :-) What does |
It tracks PETSc operations so that you can get a summary at the end of your script with FLOP/s, load imbalance, and such. It is much more trivial for me to understand the performance summary from PETSc to split preconditioner setup vs. solution phase (I'm interested in benchmarking multiple preconditioners, so I need to breakdown the The PETSc error message says that |
I agree that that might be useful, but I'm afraid that it's fairly low on the priority list of anyone to fix. The PETSc solver interfaces were written in 2003 or 2004, and I don't think anyone readily remembers how they work and this is the first time anyone has brought up the issue :-) |
@prj- With PETSc version 3.16.2, I am running into the same issues as you for Step-40, with the original Step-40 file and the command line arguments. Same issue appears with the modified Step-40 file, with additional arguments However, making the changes above with PETSc version 3.13.2, I am not running into any errors, even with appending I also repeated your call to The execution times between the command line version and explicitly modifying the preconditioner to be PreconditionBlockJacobi in Step-40 are the same, with either version of PETSc (leaving out Can you try building deal.II with an older version of PETSc (v. 3.13.2) and see if your issues persists and/or the results are what you expect? |
Indeed, this is working on my side as well.
That's great news. I'll git bisect down to tag |
Just FYI.
I'll try to see with @BarrySmith (author of that MR) what he thinks about this. |
We are sorting this out upstream (see https://gitlab.com/petsc/petsc/-/merge_requests/3320#note_798371459 and https://gitlab.com/petsc/petsc/-/merge_requests/4685 for reference). Thanks for your help and for the reproducer. |
Thanks for sorting it out! I love these cross-project things! Just because the deal.II interfaces are what they are, there is no reasons that they need to stay that way. It sounds like you already identified what is triggering the issue; if there is an easy way to address things (like initializing the KSP before the PC is attached to it), then that is something we can certainly do. |
What you do in the interface is not the canonical way of doing things in PETSc (different mental model again, to quote you). If I understood the code correctly, you first create a |
For reference, this is where things are done:
If I understand things right, then the problem is that at this point we have already created the PC and only attach it to the KSP after the fact? The PC is created during the construction of the |
My initial problem (
That would fix both problems indeed. But still, PETSc purists would say that there is no real point for you to keep a reference to both a (*) The purest of the purists will say that you only need a reference to a |
I'm compiling deal.II 9.3.2 with the following configuration line.
I'm using PETSc
main
branch.When I run the following, everything is OK.
However, if I switch from
hypre
to some other PC, likebjacobi
, I get hit by the following.I don't know enough about deal.II and the plumbing done under the hood with PETSc to fix this (or reproduce this on a simpler MWE). Any help would be appreciated.
The text was updated successfully, but these errors were encountered: