[petsc-users] Must call MatXXXSetPreallocation() or MatSetUp() on argument 1 "mat" before MatGetFactorAvailable()

Mehrzad Samadi mehrzads at umich.edu
Wed Jul 15 11:45:53 CDT 2015


Thank you Hong,

No I do not need that function. I'm looking for an example that reads a
matrix from file and run pcg solver on it. I want to run it with CUDA and
MPI.
/ksp/examples/tutorials/ex2.c is a good example but it does not read from
file and for some reason I cannot make "reading from file work".
How can I find a working code like that?

Best,
Mehrzad

On Wed, Jul 15, 2015 at 12:13 PM Hong <hzhang at mcs.anl.gov> wrote:

> Mehrzad :
> The error occurs at MatCreateNormal(A,&N), a function rarely used and not
> well tested. We will fix it.
>
> Do you need this function?
>
> Hong
>
> Hello everyone,
>>
>> I'm really new to Petsc and when I try to run
>> ksp/ksp/examples/tutorials/ex27
>>
>> I get this error
>>
>> [0]PETSC ERROR: Object is in wrong state
>> [0]PETSC ERROR: Must call MatXXXSetPreallocation() or MatSetUp() on
>> argument 1 "mat" before MatGetFactorAvailable()
>> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
>> for trouble shooting.
>> [0]PETSC ERROR: Petsc Release Version 3.6.0, unknown
>> [0]PETSC ERROR: ./ex27 on a arch-linux2-cxx-debug named scourge by
>> mehrzads Wed Jul 15 11:27:48 2015
>> [0]PETSC ERROR: Configure options --with-mpi=1 --prefix=/opt/petsc
>> --with-clanguage=cxx
>> [0]PETSC ERROR: #1 MatGetFactorAvailable() line 4199 in /../matrix.c
>> [0]PETSC ERROR: #2 PCGetDefaultType_Private() line 27 in /../precon.c
>> [0]PETSC ERROR: #3 PCSetFromOptions() line 159 in /../pcset.c
>> [0]PETSC ERROR: #4 KSPSetFromOptions() line 358 in /../itcl.c
>>
>>
>> Can you help me identify the problem?
>>
>> Best,
>> Mehrzad
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150715/f844665c/attachment.html>


More information about the petsc-users mailing list