<div dir="ltr"><div>Thank you for the reply. </div><div>Sure, a short example code is attached here with a square box mesh and a run script. </div><div>Inside the source, you may find two versions of halo exchange; one is for local to global (Version-1) and another one is for local to local (Version-2), which is not working in my case. </div><div>In the output.vtu, you will see the halo exchanged vector resolved to each vertex with (myrank + 1), so if the code is running with 2procs, at the parallel boundary, you will see 3. In this example, there is no ghost layer.</div><div><br></div><div>Thanks,</div><div>Mike</div><br><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 dir="ltr"><div dir="ltr"><br>On Sat, Oct 1, 2022 at 8:51 PM Mike Michell <<a href="mailto:mi.mike1021@gmail.com" target="_blank">mi.mike1021@gmail.com</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 dir="ltr"><div dir="ltr">Thank you for the reply. There is that file in src/dm/interface/ftn-auto/ for me, instead of the path you mentioned. <br><br>After "make allfortranstubs" was done and, PETSc reconfigured and reinstalled.</div><div dir="ltr"><br>However, I still have the same problem at the line in which DMLocalToLocalBegin() is used. What I am doing to setup halo exchange is as follows; <br>- declare DMPlex<br>- PetscSectionCreate()<br>- PetscSectionSetNumFields()<br>- PetscSectionSetFieldComponents()<br>- PetscSectionSetChart()<br>- do loop over dofs: PetscSectionSetDof() and PetscSectionSetFieldDof()<br>- PetscSectionSetUp()<br>- DMSetLocalSection()<br>- PetscSectionDestroy()<br>- DMGetSectionSF()<br>- PetscSFSetUp()<br><br>Then, the halo exchange is performed as follows;<br>- DMGetLocalVector()<br>- Fill the local vector<br>- DMLocalToLocalBegin() --(*)<br>- DMLocalToLocalEnd()<br>- DMRestoreLocalVector()<br><br>Then, the code crashes at (*).<br></div></div></blockquote><div><br></div><div>Can you send something I can run? Then I will find the problem and fix it.</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"><div dir="ltr"><div dir="ltr">Previously(at the time PETSc did not support LocalToLocal for DMPlex in Fortran), the part above, "DMLocalToLocalBegin() and DMLocalToLocalEnd()", consisted of; <br>- DMLocalToGlobalBegin()<br>- DMLocalToGlobalEnd()<br>- DMGlobalToLocalBegin()<br>- DMGlobalToLocalEnd()<br>and it worked okay. <br><br>I am unclear which part is causing the problem. Shall I define the PetscSection and PetscSF in different ways in case of Local to Local Halo exchange? <br>Any comment will be appreciated.<br><br>Thanks,<br>Mike<br></div><div dir="ltr"><br></div><br><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 dir="ltr"><div dir="ltr"><br>On Fri, Sep 30, 2022 at 4:14 PM Mike Michell <<a href="mailto:mi.mike1021@gmail.com" target="_blank">mi.mike1021@gmail.com</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 dir="ltr"><div>Hi,</div><div><br></div><div>As a follow-up to this email thread, </div><a href="https://www.mail-archive.com/petsc-users@mcs.anl.gov/msg44070.html" target="_blank">https://www.mail-archive.com/petsc-users@mcs.anl.gov/msg44070.html</a><br><div><br></div><div>Are DMLocalToLocalBegin() and DMLocalToLocalEnd() really available for DMPlex with Fortran on the latest version of PETSc (3.17.99 from GitLab)? Matt commented that the Fortran bindings were updated so that those functions must be available in the latest version of PETSc, however, it seems still they are not working from my test with DMPlex in Fortran. Can anyone provide some comments? Probably I am missing some mandatory header file? Currently, I have headers;</div><div><br></div><div>#include "petsc/finclude/petscvec.h"</div><div><div>#include "petsc/finclude/petscdmplex.h"</div><div><div>#include "petsc/finclude/petscdmlabel.h"</div><div><div>#include "petsc/finclude/petscdm.h"</div></div></div></div></div></blockquote><div><br></div><div>The source for these functions is in</div><div><br></div><div> src/dm/ftn-auto/dmf.c</div><div><br></div><div>Is it there for you? If not, you can run</div><div><br></div><div> make allfortranstubs</div><div><br></div><div>Fortran functions are not declared, so the header should not matter for compilation, just the libraries for linking.</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"><div dir="ltr"><div>Thanks,</div><div>Mike</div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><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>
</blockquote></div></div>