<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div>Great thanks, that seemed to work well. This is something my algorithm will do fairly often (“elevating” a node’s communicator to a communicator that includes siblings). The matrices formed are dense but low rank. With MatCreateSubMatrix, it appears I do a lot of copying from one Mat to another. Is there a way to do it with array copying or pointer movement instead of copying entries?</div><div><br></div><div>-Damyn</div><div>
</div>
<div><br><blockquote type="cite"><div>On Oct 24, 2023, at 9:51 PM, Jed Brown <jed@jedbrown.org> wrote:</div><br class="Apple-interchange-newline"><div><div>You can place it in a parallel Mat (that has rows or columns on only one rank or a subset of ranks) and then MatCreateSubMatrix with all new rows/columns on a different rank or subset of ranks.<br><br>That said, you usually have a function that assembles the matrix and you can just call that on the new communicator.<br><br>Damyn Chipman <damynchipman@u.boisestate.edu> writes:<br><br><blockquote type="cite">Hi PETSc developers,<br><br>In short, my question is this: Does PETSc provide a way to move or copy an object (say a Mat) from one communicator to another?<br><br>The more detailed scenario is this: I’m working on a linear algebra solver on quadtree meshes (i.e., p4est). I use communicator subsets in order to facilitate communication between siblings or nearby neighbors. When performing linear algebra across siblings (a group of 4), I need to copy a node’s data (i.e., a Mat object) from a sibling’s communicator to the communicator that includes the four siblings. From what I can tell, I can only copy a PETSc object onto the same communicator.<br><br>My current approach will be to copy the raw data from the Mat on one communicator to a new Mat on the new communicator, but I wanted to see if there is a more “elegant” approach within PETSc.<br><br>Thanks in advance,<br><br>Damyn Chipman<br>Boise State University<br>PhD Candidate<br>Computational Sciences and Engineering<br>damynchipman@u.boisestate.edu<br></blockquote></div></div></blockquote></div><br></body></html>