<div dir="ltr"><div dir="ltr">On Thu, Oct 28, 2021 at 9:37 AM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</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"><br>
Matt,<br>
<br>
How difficult would it be to rework DMPLEX to allow the use of VecGhost? We have performance problems with GPUs with simple DMNETWORK models because the code spends more time uselessly copying the local part of the vector to another vector in global to local and local to global; more than 1/2 the time of the total simulation.<br></blockquote><div><br></div><div>Firedrake already does this because they "vec ghost" their vectors by default. Here is what you need:</div><div><br></div><div> When you create the PetscSection, by default it orders the unknowns according to the default point numbering. This</div><div> is what causes the ghost unknowns to be mixed in with the local unknowns. However, PetscSection allows you to set</div><div> a point permutation</div><div><br></div><div> <a href="https://petsc.org/main/docs/manualpages/PetscSection/PetscSectionSetPermutation.html">https://petsc.org/main/docs/manualpages/PetscSection/PetscSectionSetPermutation.html</a></div><div><br></div><div> This determines the order of dogs by iterating through points in this permutation, and you can put all shared points at the end.</div><div><br></div><div>Does this make sense?</div><div><br></div><div> Thanks,</div><div><br></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">
Barry<br></blockquote></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>