[petsc-users] DAGetMatrix with extra nonzeros: memory preallocation

Mohamad M. Nasr-Azadani mmnasr at gmail.com
Sun Sep 11 05:44:20 CDT 2011


Thanks Jed,
I will give it a shot. I think I will need your help though, it sounds a
tedious task to digg into low-level PETSc codes. :-)

Best,
Mohamad


On Sat, Sep 10, 2011 at 2:15 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> On Sat, Sep 10, 2011 at 23:03, Mohamad M. Nasr-Azadani <mmnasr at gmail.com>wrote:
>
>> Is there any example that could guide me on that?
>
>
> Unfortunately there is not. You can read the man page for
> MatMPIAIJSetPreallocation() and look at the implementations in DMDA that use
> this API (e.g. DMGetMatrix_DA_2d_MPIAIJ in src/dm/impls/da/fdda.c -- your
> implementation should be somewhat simpler because you only need one stencil
> in the interior).
>
> It would be good to have an example of preallocating for something
> nontrivial, so if you write one, we can add it (and help debug if you get
> stuck).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110911/fdc1c31b/attachment.htm>


More information about the petsc-users mailing list