Fwd: matrices without diagonals...
Todd Munson
tmunson at mcs.anl.gov
Wed Oct 31 10:53:49 CDT 2007
The problem I encountered is in:
src/mat/impls/aij/seq/aijfact.c
The MatICCFactorSymbolic_SeqAIJ does not check for empty rows when the
number of levels is set to zero. For a larger number of levels it does
get checked.
I changed my code to add the diagonal into the matrix to prevent the error
from occuring...
Cheers, Todd.
On Tue, 30 Oct 2007, Barry Smith wrote:
>
> Todd,
>
> You are correct!
>
> There is a routine MatMissingDiagonal(). Routines that
> implicitly require all diagonal entries in the data structure
> are suppose to call this routine and check the flag before
> chugging along. It appears that this code is not always
> called when needed.
>
> Note that many methods DO NOT require the diagonal entries
> so MatMissingDiagonal() should not be called willy-nilly
> but only when needed.
>
> Please report to petsc-maint at mcs.anl.gov the routines that
> crash for you and we will add the error checking (note matrix
> type in the report).
>
> Barry
>
>
> On Tue, 30 Oct 2007, Todd Munson wrote:
>
>>
>> I'll let you all decide the best course of action. I'm just going to make the
>> statement that a core dump is not a valid way to signify that the diagonal
>> does not exist. Something needs to be done...
>>
>> SeqAIJ has a PetscScalar* for the various diagonal entries; not sure why the
>> others do not do something similar if the diagonal is always required.
>>
>> Todd.
>>
>> On Tue, 30 Oct 2007, Matthew Knepley wrote:
>>
>>> I may be wrong, but I think a lot of AIJ methods need the diagonal. Do we
>>> think
>>> it is feasible to relax this? I would be more for filling the diagonal
>>> with zeros
>>> automatically.
>>>
>>> Matt
>>>
>>> ---------- Forwarded message ----------
>>> From: Todd Munson <tmunson at mcs.anl.gov>
>>> Date: Oct 30, 2007 9:18 AM
>>> Subject: matrices without diagonals...
>>> To: Barry Smith <bsmith at mcs.anl.gov>
>>> Cc: Matthew Knepley <knepley at mcs.anl.gov>
>>>
>>>
>>>
>>> Barry,
>>>
>>> We discussed this yesterday and I want to come to a conclusion before I go
>>> and change any code. The problem is that some of the matrix I have do not
>>> have diagonal entries...in fact both the rows and columns do not have any
>>> nonzeros. Rather than PETSc terminating gracefully and telling me the
>>> problem, I get a segmentation violation and a core dump.
>>>
>>> There are two questions:
>>>
>>> 1) Which functions require a diagonal?
>>> 2) Should these functions check for the diagonal and abort with a useful
>>> error message?
>>>
>>> My feeling is that the diagonal is required only in a few cases and it may
>>> not even be necessary, but I've been known to be wrong before. Most of
>>> the code should work without requiring diagonal entries, which is why it
>>> should only check for them when necessary.
>>>
>>> Todd.
>>>
>>>
>>>
>>> --
>>> What most experimenters take for granted before they begin their
>>> experiments is infinitely more interesting than any results to which
>>> their experiments lead.
>>> -- Norbert Wiener
>>>
>>>
>>
>>
>
>
More information about the petsc-dev
mailing list