<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 8, 2023 at 6:50 PM Danyang Su <<a href="mailto:danyang.su@gmail.com">danyang.su@gmail.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 class="msg-8320575161104579732"><div lang="EN-CA" style="overflow-wrap: break-word;"><div class="m_-8320575161104579732WordSection1"><p class="MsoNormal"><span style="font-size:11pt">Dear PETSc-Users,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">Is there any changes in ISLocalToGlobalMappingGetIndices function after PETSc 3.17? <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">In the previous PETSc version (<= 3.17), the function ‘ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr)’ works fine, even though the value of idltog looks out of bound (-11472655627481), <a href="https://www.mcs.anl.gov/petsc/petsc-3.14/src/ksp/ksp/tutorials/ex14f.F90.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-3.14/src/ksp/ksp/tutorials/ex14f.F90.html</a>. The value of idltog is not clear.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">In the latest PETSc version,  this function can be called, but due to the extreme value of idltog, the code fails. I also tried to use ‘ISLocalToGlobalMappingGetIndicesF90(ltogm,ltog,ierr)’ () but no success.</span></p></div></div></div></blockquote><div><br></div><div>* You do want the latter:</div><div><br></div><div>doc/changes/319.rst:- Deprecate ``ISLocalToGlobalMappingGetIndices()`` in favor of ``ISLocalToGlobalMappingGetIndicesF90()``<br></div><div><br></div><div>* You might look at a test:</div><div><br></div><div>src/ksp/ksp/tutorials/ex14f.F90:      PetscCall(ISLocalToGlobalMappingGetIndicesF90(ltogm,ltog,ierr))<br></div><div><br></div><div>* If you use 64 bit integers be careful. </div><div><br></div><div>* You want to use a memory checker like Valgrind or Sanitize.</div><div> </div><div>Mark</div><div><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 class="msg-8320575161104579732"><div lang="EN-CA" style="overflow-wrap: break-word;"><div class="m_-8320575161104579732WordSection1"><p class="MsoNormal"><span style="font-size:11pt"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">#if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR <= 4)</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">call</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"> DMDAGetGlobalIndicesF90(dmda_flow%da,PETSC_NULL_INTEGER,  &<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">                                     idx,ierr)<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        CHKERRQ(ierr)<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">#else</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">call</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"> DMGetLocalToGlobalMapping(dmda_flow%da,ltogm,ierr)<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        CHKERRQ(ierr)<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">call</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"> ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr)<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        CHKERRQ(ierr)<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">#endif</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        <u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        dof = dmda_flow%dof<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">      <u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">do</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"> ivol = </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(181,206,168)">1</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">, nngl<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u> <u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">#if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR <= 4)</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">            node_idx_lg2pg(ivol) = (idx(ivol*dof)+</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(181,206,168)">1</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">)/dof<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">#else</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">            node_idx_lg2pg(ivol) = (ltog(ivol*dof + idltog)+</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(181,206,168)">1</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">)/dof<u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">#endif</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal" style="line-height:15.75pt;background:rgb(30,30,30)"><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)">        </span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(86,156,214)">end do</span><span style="font-size:10.5pt;font-family:Menlo;color:rgb(212,212,212)"><u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">Any suggestions on that. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">Thanks,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11pt">Danyang<u></u><u></u></span></p></div></div>
</div></blockquote></div></div>