[petsc-users] Clarification for use of MatMPIBAIJSetPreallocationCSR

Barry Smith bsmith at petsc.dev
Sun Mar 3 16:07:40 CST 2024


Clarify in documentation which routines copy the provided values https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/merge_requests/7336__;!!G_uCfscf7eWS!Z2j2ynvPrOvIKRuhQdogedQsz8yANmf4jbsUEXvXz2afujWJLfsAdG45b-wsInVpXM3tB3H6h1vTdYbzamBV5hs$ 

> On Mar 2, 2024, at 6:40 AM, Fabian Wermelinger <fab4100 at posteo.ch> wrote:
> 
> This Message Is From an External Sender
> This message came from outside your organization.
> On Fri, 01 Mar 2024 12:51:45 -0600, Junchao Zhang wrote:
> >> The preferred method then is to use MatSetValues() for the copies (or
> >> possibly MatSetValuesRow() or MatSetValuesBlocked())?
> > MatSetValuesRow()
> 
> Thanks
> 
> >> The term "Preallocation" is confusing to me.  For example,
> >> MatCreateMPIBAIJWithArrays clearly states in the doc that arrays are copied
> >> (https://urldefense.us/v3/__https://petsc.org/release/manualpages/Mat/MatCreateMPIBAIJWithArrays/__;!!G_uCfscf7eWS!cls7psuvaRuDYuXpUpmU7lcEhX9AO0bb3qTpszwuTNP8LPPrJkCzoaHIdJCzxPR36D7SLYs9MKCxqMBKRnSQc8s$), I
> >> would then assume PETSc maintains internal storage for it.  If something is
> >> preallocated, I would not make that assumption.
> >"Preallocation" in petsc means "tell petsc sizes of rows in a matrix",  so that
> >petsc can preallocate the memory before you do MatSetValues(). This is clearer
> >in https://urldefense.us/v3/__https://petsc.org/release/manualpages/Mat/MatMPIAIJSetPreallocation/__;!!G_uCfscf7eWS!cls7psuvaRuDYuXpUpmU7lcEhX9AO0bb3qTpszwuTNP8LPPrJkCzoaHIdJCzxPR36D7SLYs9MKCxqMBKrYGemdo$
> 
> Thanks for the clarification!
> 
> All best,
> 
> -- 
> fabs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240303/c0d438ef/attachment-0001.html>


More information about the petsc-users mailing list