[petsc-users] Memory for matrix assembly

Jed Brown jedbrown at mcs.anl.gov
Mon Nov 21 23:59:07 CST 2011


On Mon, Nov 21, 2011 at 23:46, Andrej Mesaros <andrej.mesaros at bc.edu> wrote:

> My code has a function which, when given a fixed matrix row index,
> calculates one by one values of all non-zero matrix elements in this row,
> while also returning the column index of each of these elements. So, all I
> need to do is put that the 1st process has a loop for row index going from
> 1 to 60k, the 2nd process has the loop going from 60k+1 to 120k, etc.
> Inside the loops, the row index is given, so it finds the non-zero elements
> and their column indices.
>

That is fine, but the error circumnstance indicated that a huge number of
entries were being computed by a different process. It is possible that
memory was corrupted earlier. You can try smaller problems with valgrind or
-malloc_debug -malloc_dump, but if these don't work, it could be difficult
to track down.

To clarify, is "n" the matrix dimension? So that's memory for 100 vectors
>> (the Krylov space) plus the memory already taken by PETSc when assembly is
>> done?
>
>
Yeah, roughly that used by PETSc plus those additional vectors needed by
SLEPc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111121/5c46b4b7/attachment.htm>


More information about the petsc-users mailing list