<div dir="ltr"><div>Maybe I'm not understanding you -- matCopy does not have your sub-communicator so how would it create a Mat with it ...<br></div><div><div><br></div>You probably want to use MatGetSubmatrix. This is general, but the output will have the same communicator, but the idle processors will be empty, if that is what you specify.<div><div>Now you just need to replace the communicator with your sub communicator. Not sure how to do this but now you have your data in the right place at least.</div></div></div><div><br></div><div>Oh, there is a method to create a Mat with a sub communicator with non-empty rows. Now you use this and use the communicator in the new matrix as your sub-communicator.</div><div><br></div><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAdjCreateNonemptySubcommMat.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAdjCreateNonemptySubcommMat.html</a><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 27, 2020 at 11:59 AM David Knezevic <<a href="mailto:david.knezevic@akselos.com">david.knezevic@akselos.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I have a case where I'd like to copy a Mat defined on COMM_WORLD to a new Mat defined on some sub-communicator. Does MatCopy support this, or would I have to write a custom copy operation?</div><div><br></div><div>I see <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatConvert.html#MatConvert" target="_blank">here</a> that MatConvert requires identical communicators, but I don't see any mention of this for MatCopy, so I wanted to check.</div><div><br></div><div>Thanks,<br>David</div></div>
</blockquote></div>