<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><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 and MPICreateSubMatricesMPI with dense and/or elemental matrices ?
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div name="quoted-content">
<div style="font-family: Verdana;font-size: 12.0px;">
<p style="margin-bottom: 11.0px;"><span style="font-size: 11.0pt;"><span style="line-height: 107.0%;"><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: 11.0px;"><span style="font-size: 11.0pt;"><span style="line-height: 107.0%;"><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: 11.0px;"><span style="font-size: 11.0pt;"><span style="line-height: 107.0%;"><span style="font-family: Calibri , sans-serif;">Thanks and Best,</span></span></span></p>
<p style="margin-bottom: 11.0px;"><span style="font-size: 11.0pt;"><span style="line-height: 107.0%;"><span style="font-family: Calibri , sans-serif;">Marius</span></span></span></p>
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"> </div>
<div>
<div>
<div>
<div>On Tue, Mar 12, 2019 at 4:50 AM Marius Buerkle <<a href="mailto:mbuerkle@web.de" onclick="parent.window.location.href='mailto:mbuerkle@web.de'; return false;" target="_blank">mbuerkle@web.de</a>> wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<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: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0.0px 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0.0px 0.0px 10.0px;"> </div>
<div>
<div>
<div>On Wed, Feb 20, 2019 at 6:57 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de" onclick="parent.window.location.href='mailto:mbuerkle@web.de'; return false;" target="_blank">mbuerkle@web.de</a>> wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<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: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div> </div>
<div>marius</div>
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0.0px 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0.0px 0.0px 10.0px;"> </div>
<div>
<div>
<div>On Tue, Feb 19, 2019 at 8:42 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de" onclick="parent.window.location.href='mailto:mbuerkle@web.de'; return false;" target="_blank">mbuerkle@web.de</a>> wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">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: 12.0px;">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: 12.0px;">Then its really just a matter of reversing the communication call.</span></div>
<div> </div>
<div><span style="font-family: Verdana;font-size: 12.0px;"> Matt </span></div>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0.0px 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0.0px 0.0px 10.0px;"> </div>
<div>
<div>
<div>On Tue, Feb 19, 2019 at 7:12 PM Marius Buerkle <<a href="mailto:mbuerkle@web.de" onclick="parent.window.location.href='mailto:mbuerkle@web.de'; return false;" target="_blank">mbuerkle@web.de</a>> wrote:</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<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: 12.0px;"> </span></div>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<div>marius</div>
<div>
<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0.0px 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0.0px 0.0px 10.0px;"> </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" onclick="parent.window.location.href='mailto:petsc-users@mcs.anl.gov'; return false;" target="_blank">petsc-users@mcs.anl.gov</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin: 0.0px 0.0px 0.0px 0.8ex;border-left: 1.0px solid rgb(204,204,204);padding-left: 1.0ex;">
<div>
<div style="font-family: Verdana;font-size: 12.0px;">
<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_-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_-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_-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_-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_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></body></html>