[petsc-users] Can I eliminate all mallocs in parallel matrix assembly?

Markus Berndt berndt at lanl.gov
Wed Oct 16 10:10:40 CDT 2013


I am setting MAT_NEW_NONZERO_ALLOCATION_ERR to PETSC_FALSE, the PETSc 
version is 3.3-p6.

Thanks for clarifying this. Just to make sure I understand correctly, by 
providing the correct values in d_nnz and o_nnz I should always be able 
to avoid any mallocs in matrix assembly?

I will dig in with a debugger as you suggest

Thanks

- Markus

On 10/16/2013 08:57 AM, Jed Brown wrote:
> Markus Berndt <berndt at lanl.gov> writes:
>
>> I am trying to minimize the memory footprint of an application by
>> specifying exactly how many nonzeros are needed per row of the matrix. I
>> am pretty sure that I am correctly calculating these memory requirements
>> for the diagonal and off diagonal parts of the parallel matrix (I am
>> using MatCreateAIJ).
> Either you have called another function later that clears the
> preallocation information or the information you provided is incorrect.
>
> What version of PETSc are you using?  We currently set
> MAT_NEW_NONZERO_ALLOCATION_ERR by default so you should get an error
> when a new nonzero triggers allocation.  You can catch that in a
> debugger and figure out why there are more nonzeros than you allocated
> for.

-- 
Markus Berndt - CCS-2 - LANL - 505-665-4711



More information about the petsc-users mailing list