Thanks Jed, <div>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. :-)</div><div><br></div><div>Best, </div><div>Mohamad</div><div><br></div><div><br>
<div class="gmail_quote">On Sat, Sep 10, 2011 at 2:15 PM, Jed Brown <span dir="ltr">&lt;<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><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" target="_blank">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><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>
</blockquote></div><br></div>