<div dir="ltr"><div dir="ltr">On Mon, Mar 18, 2019 at 10:30 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de">mbuerkle@web.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>I have another question regarding MatCreateRedundantMatrix and MPICreateSubMatricesMPI. The former works for MPIAIJ and  MPIDENSE and the later only for MPIAIJ. Would it be possible to use MatCreateRedundantMatrix with a factored matrix </div></div></div></blockquote><div><br></div><div>We usually do not have direct access to the data for factored matrices since it lives in the factorization package.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>and MPICreateSubMatricesMPI with dense and/or elemental matrices ?</div></div></div></blockquote><div><br></div><div>This would not be hard, it would just take time. The dense case is easy. I think Elemental already has such an operation, but we would have to find it and call it.</div><div><br></div><div>  Thanks,</div><div><br></div><div>    Matt </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>
<div name="quote" style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229);word-wrap:break-word">
<div name="quoted-content">
<div style="font-family:Verdana;font-size:12px">
<p style="margin-bottom:11px"><span style="font-size:11pt"><span style="line-height:107%"><span style="font-family:Calibri,sans-serif">Indeed, was very easy to add. Are you going to include the Fortran interface for MPICreateSubMatricesMPI  in future releases of PETSC ?</span></span></span></p>

<p style="margin-bottom:11px"><span style="font-size:11pt"><span style="line-height:107%"><span style="font-family:Calibri,sans-serif">Regarding my initial problem, thanks a lot. It works very well with MPICreateSubMatricesMPI  and the solution can be implemented in a few lines. </span></span></span></p>

<p style="margin-bottom:11px"><span style="font-size:11pt"><span style="line-height:107%"><span style="font-family:Calibri,sans-serif">Thanks and Best,</span></span></span></p>

<p style="margin-bottom:11px"><span style="font-size:11pt"><span style="line-height:107%"><span style="font-family:Calibri,sans-serif">Marius</span></span></span></p>

<div> 
<div style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"> </div>

<div>
<div>
<div>
<div>On Tue, Mar 12, 2019 at 4:50 AM Marius Buerkle <<a href="mailto:mbuerkle@web.de" target="_blank">mbuerkle@web.de</a>> wrote:</div>

<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>I tried to follow your suggestions but it seems there is no MPICreateSubMatricesMPI for Fortran. Is this correct?</div>
</div>
</div>
</blockquote>

<div> </div>

<div>We just have to write the binding. Its almost identical to MatCreateSubMatrices() in src/mat/interface/ftn-custom/zmatrixf.c</div>

<div> </div>

<div>   Matt </div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>
<div style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"> </div>

<div>
<div>
<div>On Wed, Feb 20, 2019 at 6:57 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de" target="_blank">mbuerkle@web.de</a>> wrote:</div>

<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>ok, I think I understand now. I will give it a try and if there is some trouble comeback to you. thanks.</div>
</div>
</div>
</blockquote>

<div> </div>

<div>Cool.</div>

<div> </div>

<div>   Matt</div>

<div> </div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div> </div>

<div>marius</div>

<div>
<div style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"> </div>

<div>
<div>
<div>On Tue, Feb 19, 2019 at 8:42 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de" target="_blank">mbuerkle@web.de</a>> wrote:</div>

<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">ok, so it seems there is no straight forward way to transfer data between PETSc matrices on different subcomms. Probably doing it by "hand" extracting the matricies on the subcomms create a MPI_INTERCOMM transfering the data to PETSC_COMM_WORLD and assembling them in a new PETSc matrix would be possible, right?</div>
</div>
</blockquote>

<div> </div>

<div><span style="font-family:Verdana;font-size:12px">That sounds too complicated. Why not just reverse MPICreateSubMatricesMPI()? Meaning make it collective on the whole big communicator, so that you can swap out all the subcommunicator for the aggregation call, just like we do in that function.</span></div>

<div><span style="font-family:Verdana;font-size:12px">Then its really just a matter of reversing the communication call.</span></div>

<div> </div>

<div><span style="font-family:Verdana;font-size:12px">   Matt </span></div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>
<div style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"> </div>

<div>
<div>
<div>On Tue, Feb 19, 2019 at 7:12 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de" target="_blank">mbuerkle@web.de</a>> wrote:</div>

<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>I see. This would work if the matrices are on different subcommumicators ? Is it possible to add this functionality ?</div>
</div>
</div>
</blockquote>

<div> </div>

<div>Hmm, no. That is specialized to serial matrices. You need the inverse of MatCreateSubMatricesMPI().</div>

<div> </div>

<div>  Thanks,</div>

<div> </div>

<div>     Matt</div>

<div> <span style="font-family:Verdana;font-size:12px"> </span></div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>marius</div>

<div> 
<div style="margin:10px 5px 5px 10px;padding:10px 0px 10px 10px;border-left:2px solid rgb(195,217,229)">
<div style="margin:0px 0px 10px"> </div>

<div>
<div>You basically need the inverse of MatCreateSubmatrices(). I do not think we have that right now, but it could probably be done without too much trouble by looking at that code.
<div> </div>

<div>  Thanks,</div>

<div> </div>

<div>     Matt</div>
</div>
 

<div class="gmail_quote">
<div class="gmail_attr">On Tue, Feb 19, 2019 at 6:15 AM Marius Buerkle via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:Verdana;font-size:12px">
<div>Hi !</div>

<div> </div>

<div>Is there some way to combine MatCompositeMerge with MatCreateRedundantMatrix? I basically want to create copies of a matrix from PETSC_COMM_WORLD to subcommunicators, do some work on each subcommunicator and than gather the results back to PETSC_COMM_WORLD, namely  I want to sum the  the invidual matrices from the subcommunicatos component wise and get the resulting matrix on PETSC_COMM_WORLD. Is this somehow possible without going through all the hassle of using MPI directly? </div>

<div> </div>

<div>marius</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>
--

<div class="gmail-m_7379125999887913686gmail-m_-6485998864083133738gmail-m_-8791113756472057659gmail-m_2843557469688416611gmail-m_-2681180824371843578gmail_signature">
<div>
<div>
<div>
<div>
<div>
<div>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> </div>

<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>
--

<div class="gmail-m_7379125999887913686gmail-m_-6485998864083133738gmail-m_-8791113756472057659gmail-m_2843557469688416611gmail_signature">
<div>
<div>
<div>
<div>
<div>
<div>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> </div>

<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>
--

<div class="gmail-m_7379125999887913686gmail-m_-6485998864083133738gmail-m_-8791113756472057659gmail_signature">
<div>
<div>
<div>
<div>
<div>
<div>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> </div>

<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>
--

<div class="gmail-m_7379125999887913686gmail-m_-6485998864083133738gmail_signature">
<div>
<div>
<div>
<div>
<div>
<div>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> </div>

<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
 

<div> </div>
--

<div class="gmail-m_7379125999887913686gmail_signature">
<div>
<div>
<div>
<div>
<div>
<div>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> </div>

<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>