On 03/08/2018 02:55 PM, Feimi Yu wrote:
The problem is that I still encounter the "out of range" problem even when I
do iterator over the local rows. I debugged my code and
checked the source code, and found where the problem is:
The end iterator of each row is pointing to the first entry of the next row
(or true end if the row is the end row).
However when we have multiple ranks, when one wants to get the end iterator of
the last LOCAL row, the end
iterator will point to the next row, which is not belong to local.
Let me take an example to be clear:
I have 1223 rows, where rank 0 has the information of row 0 to 633 and rank 1
has 634 to 1222.
When I iterate over the entries on rank 1, everything works as it is.
When I iterate over the entries on rank 0, especially when it reaches row 633,
I will call matrix.end(633)
However this end is essentially matrix.begin(634)! So PETSc tells me I am out
of range, because rank 0
does not have information of row 634.
Ah, yes, I see how this can happen.
Do you think you could come up with a small testcase that shows this? This
would make it much easier to debug the problem. In essence, all you'd have to
do is create a matrix on two processors, put a few values into it (say, one
value per row) and create the iterators. The whole thing doesn't have to do
anything useful -- no need to create a mesh, assemble a linear system using
FEValues, etc --, it only has to demonstrate the exception you get.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.colostate.edu/~bangerth/
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.