[petsc-dev] Examples broken

Barry Smith bsmith at mcs.anl.gov
Wed Feb 15 09:58:37 CST 2012


On Feb 15, 2012, at 9:28 AM, Jose E. Roman wrote:

> With the latest petsc-dev I get the following error in many examples (e.g. src/ksp/ksp/examples/tutorials/ex12.c ):
> 
> [0]PETSC ERROR: Object is in wrong state!
> [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatGetOwnershipRange()!
> 
> I guess the idea is to add MatSetUp() in all examples? Or will this error be removed eventually?

   It looks like you need to as the message says either do the preallocation or call MatSetUp(). The problem is that delaying the setup may mean that it tries to do it in MatSetValues() which is not collective so one may get a hang.  Previously MatGetOwnershipRange() was sometimes a collective on the first call (if no preallocation or setup was done), now it is never a collective.


   Barry

> 
> Jose
> 
> 




More information about the petsc-dev mailing list