<div dir="ltr">On Fri, Apr 12, 2013 at 11:49 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Apr 12, 2013, at 5:22 PM, Jed Brown wrote:<br>
<br>
> Hui Zhang <<a href="mailto:mike.hui.zhang@hotmail.com">mike.hui.zhang@hotmail.com</a>> writes:<br>
><br>
>> Assembly it directly. I just found MatGetSubMatricesParallel.<br>
><br>
> This is not a private implementation function so it's not a good place<br>
> to learn.  It also doesn't do what you want.<br>
><br>
> For your purpose, you can either loop over the entries of A_i inserting<br>
> them according to the R_i<br>
<br>
I can understand this method.  A further question: since Ai itself is shared<br>
by many processors,  MatSetValues to A should be called by only one of the<br>
processor sharing Ai.  Is it right?<br></blockquote><div><br></div><div style>MatSetValues() is not collective.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

> or you can create a block diagonal parallel<br>
> matrix A_i constructed by joining together all the diagonal blocks.<br>
<br>
Which function can do this?  I only found diagonal block Mat with each block<br>
of the same size and dense.  Thanks!<br></blockquote><div><br></div><div style>This is just a simple shift in index with normal MatSetValues().</div><div style><br></div><div style>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

> Presumably R is already parallel, so then you can use MatPtAP to<br>
> assemble the product.<br>
><br>
> Note that you might be able to assemble the block diagonal A directly.<br>
><br>
>> Maybe I can learn from the source codes of this function but I can not<br>
>> find where they are.<br>
><br>
> For navigating source code, see the manual section about setting up GNU<br>
> Global tags or etags.  PETSc functions are named to tab complete well<br>
> with tags.<br>
><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</div></div>