error when trying to initialize PETSc preconditioners

50 views
Skip to first unread message

Ignacio Tomas

unread,
Aug 12, 2016, 9:46:30 PM8/12/16
to deal.II User Group
Hi, everybody. I am just trying to initialize either ICC, Jacobi or ParaSalis preconditioner from PETSc, using a PETSc matrix in parallel. So far I am running just one mpi process. After the call to ''.initialize'' I get:




[0]PETSC ERROR: No support for this operation for this object type
[0]PETSC ERROR: Matrix format mpiaij does not have a built-in PETSc ICC
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.5.3, Jan, 31, 2015 
[0]PETSC ERROR: ./main on a arch-linux2-c-opt named nachote by nachotex Fri Aug 12 20:28:49 2016
[0]PETSC ERROR: Configure options --download-fblaslapack=1 --with-shared-libraries=1 --download-hypre=1 --download-mumps=1 --download-spooles=1 --download-scalapack=1 --download-metis=1 --download-parmetis=1 --download-blacs=1 --with-debugging=0 --with-x=0
[0]PETSC ERROR: #1 MatGetFactor() line 3960 in /home/nachotex/Documents/deal/PETSC/petsc-3.5.3/src/mat/interface/matrix.c
[0]PETSC ERROR: #2 PCSetup_ICC() line 18 in /home/nachotex/Documents/deal/PETSC/petsc-3.5.3/src/ksp/pc/impls/factor/icc/icc.c
[0]PETSC ERROR: #3 PCSetUp() line 902 in /home/nachotex/Documents/deal/PETSC/petsc-3.5.3/src/ksp/pc/interface/precon.c
terminate called after throwing an instance of 'dealii::LACExceptions::ExcPETScError'
  what():  
--------------------------------------------------------
An error occurred in line <384> of file </home/nachotex/Documents/deal/deal/dealii-8.4.1/source/lac/petsc_precondition.cc> in function
    void dealii::PETScWrappers::PreconditionICC::initialize(const dealii::PETScWrappers::MatrixBase&, const dealii::PETScWrappers::PreconditionICC::AdditionalData&)
The violated condition was: 
    ierr == 0
The name and call sequence of the exception was:
    ExcPETScError(ierr)
Additional Information: 
An error with error number 56 occurred while calling a PETSc function




Any clue? Did I forget to install something?

Timo Heister

unread,
Aug 12, 2016, 10:31:36 PM8/12/16
to dea...@googlegroups.com
Hey Ignacio,

good to hear from you!

Sadly this is not documented well, but the ICC preconditioner is only
implemented for BAIJ matrices and not MPIAIJ (which we use even if you
run on one processor), see
https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/PC/PCICC.html

You should be able to make it work by using a
PETScWrappers::SparseMatrix instead of an
PETScWrappers::MPI::SparseMatrix. Or, probably a better idea, just use
a preconditioner that works with parallel matrices like PreconditionBlockJacobi.

Best,
Timo
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Timo Heister
http://www.math.clemson.edu/~heister/

Ignacio Tomas

unread,
Aug 12, 2016, 11:44:39 PM8/12/16
to deal.II User Group
Many thanks Timo.

I tried PreconditionBlockJacobi and it worked. However, I am running a validation loop of progressively smaller meshes, and stops again with a error when I make the call to initialize for the second time (I have to do it, since the matrix is the same ... but has changed, I have to recompute the incomplete factorization), which is expected since ''initialize()'' can only be called once. A simple solution for this problem: declaring the preconditioner inside the validation loop rather than outside and pass it as an argument to the routine that solves the linear system. 

Yes, is there a better solution? Say for instance, as with trilinos preconditioners that have a ''clear()'' function member so that you can reinitialize it with a new matrix (this is particularly useful in adaptivity loops, like in step-32). 

That's all for now.

Many Thanks.

Ignacio.

Ignacio Tomas

unread,
Aug 12, 2016, 11:47:59 PM8/12/16
to deal.II User Group

Many thanks Timo.


I tried PreconditionBlockJacobi and it worked. However, I am running a validation loop of progressively smaller meshes, and stops again with a error when I make the call to initialize for the second time which is expected since ''initialize()'' can only be called once. Of course, there a simple solution for this problem: declaring the preconditioner inside the loop rather than outside and pass it as an argument to the routine that solves the linear system.


Yet, is there a better solution? Say for instance, as with trilinos preconditioners that have a ''clear()'' function member to releases the preconditioner from the matrix, releases memory and so on, so that you can reinitialize it with a new matrix (this is particularly useful in adaptivity loops, like in step-32).


That's all for now.


Many Thanks.


Ignacio.




On Friday, August 12, 2016 at 9:31:36 PM UTC-5, Timo Heister wrote:

Timo Heister

unread,
Aug 13, 2016, 1:04:33 PM8/13/16
to dea...@googlegroups.com
> and stops again with a
> error when I make the call to initialize for the second time which is
> expected since ''initialize()'' can only be called once.

I would hope that calling initialize() more than once works. What is
the error you are getting?

Ignacio Tomas

unread,
Aug 13, 2016, 5:28:12 PM8/13/16
to dea...@googlegroups.com
This is the whole error message





terminate called after throwing an instance of 'dealii::StandardExceptions::ExcInvalidState'
  what():  
--------------------------------------------------------
An error occurred in line <68> of file </home/nachotex/Documents/deal/deal/dealii-8.4.1/source/lac/petsc_precondition.cc> in function
    void dealii::PETScWrappers::PreconditionerBase::create_pc()
The violated condition was: 
    pc == NULL
The name and call sequence of the exception was:
    StandardExceptions::ExcInvalidState ()
Additional Information: 
(none)
--------------------------------------------------------

[nachote:11234] *** Process received signal ***
[nachote:11234] Signal: Aborted (6)
[nachote:11234] Signal code:  (-6)
[nachote:11234] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f0cacb08d10]
[nachote:11234] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f0cac14c267]
[nachote:11234] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f0cac14deca]
[nachote:11234] [ 3] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x16d) [0x7f0cac84a06d]
[nachote:11234] [ 4] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5eee6) [0x7f0cac847ee6]
[nachote:11234] [ 5] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5ef31) [0x7f0cac847f31]
[nachote:11234] [ 6] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x5f149) [0x7f0cac848149]
[nachote:11234] [ 7] /home/nachotex/Documents/deal/deal/dealii841installation/lib/libdeal_II.so.8.4.1(_ZN6dealii18deal_II_exceptions9internals11issue_errorINS_18StandardExceptions15ExcInvalidStateEEEvNS1_17ExceptionHandlingEPKciS7_S7_S7_T_+0x84) [0x7f0cb0a182d4]
[nachote:11234] [ 8] /home/nachotex/Documents/deal/deal/dealii841installation/lib/libdeal_II.so.8.4.1(_ZN6dealii13PETScWrappers18PreconditionerBase9create_pcEv+0xf9) [0x7f0cb2a72689]
[nachote:11234] [ 9] /home/nachotex/Documents/deal/deal/dealii841installation/lib/libdeal_II.so.8.4.1(_ZN6dealii13PETScWrappers23PreconditionBlockJacobi10initializeERKNS0_10MatrixBaseERKNS1_14AdditionalDataE+0x34) [0x7f0cb2a742c4]
[nachote:11234] [10] ./main(_ZN8PsystemsILi1EE26initialize_preconditionersEv+0x2c) [0x46536c]
[nachote:11234] [11] ./main(_ZN8PsystemsILi1EE23timeloopSSP2EVnotlumpedEv+0x36) [0x43ca76]
[nachote:11234] [12] ./main(_ZN8PsystemsILi1EE14validation_runEv+0x356) [0x43d376]
[nachote:11234] [13] ./main(main+0x55) [0x4354c5]
[nachote:11234] [14] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f0cac137a40]
[nachote:11234] [15] ./main(_start+0x29) [0x4356f9]
[nachote:11234] *** End of error message ***
CMakeFiles/run.dir/build.make:49: recipe for target 'CMakeFiles/run' failed
make[3]: *** [CMakeFiles/run] Aborted (core dumped)
CMakeFiles/Makefile2:130: 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:136: recipe for target 'run' failed
make: *** [run] Error 2



Clearly you can see that the error happens at 
void dealii::PETScWrappers::PreconditionerBase::create_pc()



--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/NiShx850REE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.

Timo Heister

unread,
Aug 14, 2016, 9:02:39 PM8/14/16
to dea...@googlegroups.com
Thanks, this should fix it: https://github.com/dealii/dealii/pull/2963
>> dealii+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



Ignacio Tomas

unread,
Aug 15, 2016, 2:34:43 PM8/15/16
to dea...@googlegroups.com
Timo:

Simple question: basically, now I have to download the new file ''include/deal.II/lac/petsc_precondition.h'' from the repository, replace it in my dealii source code and recompile deal, that should do the trick?

Ignacio.


>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/NiShx850REE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.

Timo Heister

unread,
Aug 15, 2016, 4:26:19 PM8/15/16
to dea...@googlegroups.com
Yes, or you wait another 2 hours (then it should be merged) and just
pull the latest development version from github.
>> >> dealii+un...@googlegroups.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> > --
>> > The deal.II project is located at http://www.dealii.org/
>> > For mailing list/forum options, see
>> > https://groups.google.com/d/forum/dealii?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "deal.II User Group" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to dealii+un...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Timo Heister
>> http://www.math.clemson.edu/~heister/
>>
>> --
>> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see
>> https://groups.google.com/d/forum/dealii?hl=en
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/dealii/NiShx850REE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> dealii+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dealii+un...@googlegroups.com.

Ignacio Tomas

unread,
Aug 15, 2016, 4:46:50 PM8/15/16
to dea...@googlegroups.com
Great! Many thanks for solving this problem. I owe at least a lunch.


>> >> For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> > --
>> > The deal.II project is located at http://www.dealii.org/
>> > For mailing list/forum options, see
>> > https://groups.google.com/d/forum/dealii?hl=en
>> > ---
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "deal.II User Group" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an

>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Timo Heister
>> http://www.math.clemson.edu/~heister/
>>
>> --
>> The deal.II project is located at http://www.dealii.org/
>> For mailing list/forum options, see
>> https://groups.google.com/d/forum/dealii?hl=en
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "deal.II User Group" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/dealii/NiShx850REE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to

>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> For more options, visit https://groups.google.com/d/optout.



--
Timo Heister
http://www.math.clemson.edu/~heister/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/NiShx850REE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.

Wolfgang Bangerth

unread,
Aug 15, 2016, 5:20:34 PM8/15/16
to dea...@googlegroups.com
On 08/15/2016 02:46 PM, Ignacio Tomas wrote:
> Great! Many thanks for solving this problem. I owe at least a lunch.

Ah, now I'm jealous I left this easy to fix bug to Timo! ;-)

Cheers
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
Reply all
Reply to author
Forward
0 new messages