Second update (sorry for so many updates)

I changed my strategy to use set(r, c, v) function to set the values so 
that I can use the const iterators. also called compress after every add:
for (auto r = Abs_A_matrix->block(0, 0).local_range().first;
r < Abs_A_matrix->block(0, 0).local_range().second; ++r)
{
for (auto itr = Abs_A_matrix->block(0, 0).begin(r);
itr != Abs_A_matrix->block(0, 0).end(r);
++itr)
{
Abs_A_matrix->block(0, 0).set(itr->row(), itr->column(), std::abs(itr->value
()));
Abs_A_matrix->block(0, 0).compress(VectorOperation::add);
}
}

This time it says:
*** Error in ' ' :free(): invalid size: 0x0000556443d63e50 ***

This seems like a out of bounds access. This happens even when I run with 1 
process.

Thanks,
Feimi

On Monday, March 5, 2018 at 12:21:46 PM UTC-5, Feimi Yu wrote:
>
> Hi,
>
> I'm using PETScWrapper to parallelize my code. In my preconditioner for 
> the GMRES solver, there is one step that requires a matrix copied from the 
> system matrix, and set all the elements to be the absolute value. It was 
> fine in serial because I can iterator over all the entries simply using the 
> iterator, but it does not work in parallel since each process only owns 
> local entries. When I run the code using iteration the error message will 
> tell me "argument out of range; Not local rows". It also tells me "Object 
> is in wrong state; Not for unassembled matrix" despite the fact that I 
> called compress(VectorOperation:add) right before the iteration.
>
> Is there any way to bypass the iteration to get an absolute value matrix 
> or to iterate locally and not trigger the "unassembled matrix" error?
>
> Thanks,
> Feimi
>
>

-- 
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.

Reply via email to