Step-40 fails with "PETSc preconditioner should have anassociated matrix set to be used in solver"

22 views
Skip to first unread message

PRAKARSH PANDEY

unread,
Jul 23, 2019, 2:57:56 PM7/23/19
to deal.II User Group
Hi,

I am having issues with using PETSC iterative solvers. I follow the steps in Step40 exactly, and I get: PETSc preconditioner should have an associated matrix set to be used in solver.

I do set the preconditioner correctly, exactly as shown in Step40. I am able to reproduce this error by running step-40 too (shown below). I am using deal.II version 9.0.1, and petsc version 3.10.3 . My question is Step-40 expected to show this error, if not, any pointers on what is causing this error?. 

Thanks,
Pandey

[ 66%] Built target step-40
[100%] Run step-40 with Release configuration
Running with PETSc on 1 MPI rank(s)...
Cycle 0:
   Number of active cells:       1024
   Number of degrees of freedom: 4225
---------------------------------------------------------
TimerOutput objects finalize timed values printed to the
screen by communicating over MPI in their destructors.
Since an exception is currently uncaught, this
synchronization (and subsequent output) will be skipped to
avoid a possible deadlock.
---------------------------------------------------------
ERROR: Uncaught exception in MPI_InitFinalize on proc 0. Skipping MPI_Finalize() to avoid a deadlock.


----------------------------------------------------
Exception on processing: 

--------------------------------------------------------
An error occurred in line <88> of file </scratch/software/dealii/dealii-9.0.1/source/lac/petsc_solver.cc> in function
    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase&, dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::PreconditionerBase&)
The violated condition was: 
    B != nullptr
Additional information: 
    PETSc preconditioner should have anassociated matrix set to be used in solver.
--------------------------------------------------------

Aborting!
----------------------------------------------------
CMakeFiles/run.dir/build.make:57: recipe for target 'CMakeFiles/run' failed
make[3]: *** [CMakeFiles/run] Error 1
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/run.dir/all' failed
make[2]: *** [CMakeFiles/run.dir/all] Error 2
CMakeFiles/Makefile2:138: recipe for target 'CMakeFiles/run.dir/rule' failed
make[1]: *** [CMakeFiles/run.dir/rule] Error 2
Makefile:144: recipe for target 'run' failed
make: *** [run] Error 2

Daniel Arndt

unread,
Jul 23, 2019, 5:17:41 PM7/23/19
to dea...@googlegroups.com
Pandey,
 

[...]
--------------------------------------------------------
An error occurred in line <88> of file </scratch/software/dealii/dealii-9.0.1/source/lac/petsc_solver.cc> in function
    void dealii::PETScWrappers::SolverBase::solve(const dealii::PETScWrappers::MatrixBase&, dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::VectorBase&, const dealii::PETScWrappers::PreconditionerBase&)
The violated condition was: 
    B != nullptr
Additional information: 
    PETSc preconditioner should have anassociated matrix set to be used in solver.
--------------------------------------------------------

This error message is really unexpected if you are running a non-modified version of step-40. Did you change anything?
It seems that you are running in Release mode. Do you see the same error message in Debug mode as well or would the code stop
to run earlier?

Best,
Daniel

PRAKARSH PANDEY

unread,
Jul 26, 2019, 2:34:16 PM7/26/19
to deal.II User Group
Yeah, I was testing it in release mode. After running in debug mode I realized i didn't have hypre installed. Now it works.

Thanks 
Prakarsh
Reply all
Reply to author
Forward
0 new messages