[petsc-users] Problem with composite DM index sets
Barry Smith
bsmith at petsc.dev
Sun Jun 22 18:50:55 CDT 2025
I'm sorry for not getting back to you sooner. I have attached a working version of your code. Since you were missing
use petscdmcomposite
the compiler could not generate the correct call to DMCompositeGetGlobalISs()
Barry

> On Jun 17, 2025, at 6:39 PM, Randall Mackie <rlmackie862 at gmail.com> wrote:
>
> Dear Petsc users -
>
> I am trying to upgrade my code to petsc-3.23 (from 3.19), and I seem to have run into a problem with DMCompositeGetGlobalISs.
>
> The example program listed on the man page for DMCompositeGetGlobalISs, https://urldefense.us/v3/__https://petsc.org/release/src/snes/tutorials/ex73f90t.F90.html__;!!G_uCfscf7eWS!YAc7RXgD2pTlFNG8iFwVi1TLBPWnKA5evixlwBL203lkD1DSCns_LprWtUTmZyeLJT_8Fvd6stiDX66wf5t6rfw$ <https://urldefense.us/v3/__https://petsc.org/release/src/snes/tutorials/ex73f90t.F90.html__;!!G_uCfscf7eWS!eBXtwfVGvvppsy1_lM2f-Z61YMsb439eVY8V9SYWa0x6VjvTiJ-rXAnhEbi08ogvqtF3s2AZJt4pk9gNeM9yAjmHvA$>, seems to indicate that a call to DMCompositeGetGlobalISs does not need to allocate the IS pointer and you just pass it directly to DMCompositeGetGlobalISs.
>
> If I compile and run the simple attached test program (say on 2 processes), I get the following error:
>
> [0]PETSC ERROR: ------------------------------------------------------------------------
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
> [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
> [0]PETSC ERROR: or see https://urldefense.us/v3/__https://petsc.org/release/faq/*valgrind__;Iw!!G_uCfscf7eWS!YAc7RXgD2pTlFNG8iFwVi1TLBPWnKA5evixlwBL203lkD1DSCns_LprWtUTmZyeLJT_8Fvd6stiDX66w3acojyM$ <https://urldefense.us/v3/__https://petsc.org/release/faq/*valgrind__;Iw!!G_uCfscf7eWS!eBXtwfVGvvppsy1_lM2f-Z61YMsb439eVY8V9SYWa0x6VjvTiJ-rXAnhEbi08ogvqtF3s2AZJt4pk9gNeM-7MIW3KA$> and https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!YAc7RXgD2pTlFNG8iFwVi1TLBPWnKA5evixlwBL203lkD1DSCns_LprWtUTmZyeLJT_8Fvd6stiDX66wXMLFE2g$ <https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!eBXtwfVGvvppsy1_lM2f-Z61YMsb439eVY8V9SYWa0x6VjvTiJ-rXAnhEbi08ogvqtF3s2AZJt4pk9gNeM_a7QtraQ$>
> [0]PETSC ERROR: --------------------- Stack Frames ------------------------------------
> [0]PETSC ERROR: The line numbers in the error traceback may not be exact.
> [0]PETSC ERROR: #1 F90Array1dCreate() at /home/rmackie/PETSc/petsc-3.23.3/src/sys/ftn-custom/f90_cwrap.c:123
> application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
>
>
> If I uncomment the line to allocate the pointer, I get a very long traceback with lots of error messages.
>
> What is the correct way to use DMCompositeGetGlobalISs in Fortran? With or without the pointer allocation, and what is the right way to do this without the errors it seems to generate?
>
> Thanks,
>
> Randy Mackie
>
> <test.F90>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250622/b83e5a1c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.F90
Type: application/octet-stream
Size: 1312 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250622/b83e5a1c/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250622/b83e5a1c/attachment-0001.html>
More information about the petsc-users
mailing list