<div class="gmail_quote">On Sat, Sep 10, 2011 at 23:03, Mohamad M. Nasr-Azadani <span dir="ltr">&lt;<a href="mailto:mmnasr@gmail.com">mmnasr@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Is there any example that could guide me on that? </blockquote></div><br><div>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).</div>
<div><br></div><div>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).</div>