[petsc-users] Help with DMPlexCreateFromCellListParallelPetsc

Mark Adams mfadams at lbl.gov
Mon Oct 6 17:26:52 CDT 2025


I think you need to reorder your points according to each processor.
If process 0 has 4 vertices, they will be numbered (0, 1, 2, 3), and if
proc 1 has one vertex it will be 4.

So, to fix this, switch vertex numbering for 2 and 4.

Mark


On Mon, Oct 6, 2025 at 3:40 PM Zhang, Chonglin <chonglin.zhang at und.edu>
wrote:

> Dear PETSc developers,
>
>
>
> I have some questions on the proper use of
> DMPlexCreateFromCellListParallelPetsc function (
> https://urldefense.us/v3/__https://petsc.org/release/manualpages/DMPlex/DMPlexCreateFromCellListParallelPetsc/__;!!G_uCfscf7eWS!Z4nwRjrsrMEicB_kYCgaYAZ-kDyLwUVzbEsc7URFCva6KyGkrF5e8yjb_GiisPeXrchhomiHO0uaDLPIzn_nbBU$ 
> <https://urldefense.us/v3/__https://petsc.org/release/manualpages/DMPlex/DMPlexCreateFromCellListParallelPetsc/__;!!G_uCfscf7eWS!YJgdfNvYGp76m3zAsH07tAaJCaPnEyuyhZdGILGu2oyhW0RSJZeX4J8-IUCVNBupO7efr7Ju5zA_5ayjZ_YkwEeCuXjIJQ2K$>).
> I am upgrading my code’s PETSc dependency from v3.16.6 to v3.24.0 (and
> v3.23.3, v3.23.6). I encountered crash with
> DMPlexCreateFromCellListParallelPetsc function:
>
>    - To show the crash, I modified the following test:
>    src/dm/impls/plex/tests/ex18.c
>    - Is there anything I am doing wrong when creating DMPlex using the
>    below mesh with this test?
>    - What is the order of vertex index (of own element) going into
>    DMPlexCreateFromCellListParallelPetsc function?
>    - What is the order of own vertex coordinates going into
>    DMPlexCreateFromCellListParallelPetsc function?
>
>
>
> Here is a detailed descriptions of what I did with ex18.c to show my
> issue: src/dm/impls/plex/tests/ex18.c
>
>    - A simple 2D square mesh with 5 vertices and 4 triangles, shared by 2
>    MPI ranks (see the below image for the mesh, also attached file).
>    - Each MPI rank owns 2 elements.
>    - MPI rank 0 owns vertex indexed as: 0, 1, 3, 4; rank 1 owns vertex
>    indexed as: 2.
>    - Modified code (with updated mesh information) is attached.
>    - The DM view output is also attached.
>    - Note: the original test with 2 triangles and 2 elements was running
>    fine.
>
>
>
>
>
> Using this new mesh, the test crashed with the following error message:
>
>
>
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: Invalid argument
> [0]PETSC ERROR: Mesh cell 1 of type triangle is inverted, |J| = 0.
> [0]PETSC ERROR: See https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!Z4nwRjrsrMEicB_kYCgaYAZ-kDyLwUVzbEsc7URFCva6KyGkrF5e8yjb_GiisPeXrchhomiHO0uaDLPI91Szcc0$ 
> <https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!YJgdfNvYGp76m3zAsH07tAaJCaPnEyuyhZdGILGu2oyhW0RSJZeX4J8-IUCVNBupO7efr7Ju5zA_5ayjZ_YkwEeCuaawmeuG$>
> for trouble shooting.
> [0]PETSC ERROR: PETSc Release Version 3.24.0, unknown
> [0]PETSC ERROR: ./ex18 with 2 MPI process(es) and PETSC_ARCH
> arch-centos_kokkos on boltzmann2 by zhangc20 Mon Oct  6 14:00:48 2025
> [0]PETSC ERROR: Configure options: --with-cc=mpicc --with-cxx=mpicxx
> --with-fc=mpif90 --with-shared-libraries=1 --with-debugging=no
> --COPTFLAGS="-g -O2 -fPIC" --CXXOPTFLAGS="-g -O2 -fPIC" --FOPTFLAGS="-g -O2
> -fPIC" --with-cuda=1 --with-cuda-arch=86 --with-cudac=nvcc --with-kokkos=1
> --with-kokkos-dir=./../install/kokkos/install/ --with-kokkos-kernels=1
> --with-kokkos-kernels-dir=./../install/kokkos-kernels/install/
> --download-metis --download-parmetis --download-fblaslapack=1
> --download-triangle --with-make-np=8 PETSC_ARCH=arch-centos_kokkos
> [0]PETSC ERROR: #1 DMPlexCheckGeometry() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plex.c:9630
> [0]PETSC ERROR: #2 DMPlexCheck() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plex.c:9807
> [0]PETSC ERROR: #3 DMSetFromOptions_NonRefinement_Plex() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plexcreate.c:5121
> [0]PETSC ERROR: #4 DMSetFromOptions_Plex() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plexcreate.c:5601
> [0]PETSC ERROR: #5 DMSetFromOptions() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/interface/dm.c:907
> [0]PETSC ERROR: #6 CreateMesh() at ex18.c:811
> [0]PETSC ERROR: #7 main() at ex18.c:1527
> [0]PETSC ERROR: PETSc Option Table entries:
> [0]PETSC ERROR: -dm_plex_check_all 1 (source: command line)
> [0]PETSC ERROR: -dm_view ascii:dm_mesh.txt:ascii_info_detail (source:
> command line)
> [0]PETSC ERROR: -interpolate create (source: command line)
> [0]PETSC ERROR: ----------------End of Error Message -------send entire
> error message to petsc-maint at mcs.anl.gov----------
> Abort(62) on node 0 (rank 0 in comm 16): application called
> MPI_Abort(MPI_COMM_SELF, 62) - process 0
> [1]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [1]PETSC ERROR: Invalid argument
> [1]PETSC ERROR: Mesh cell 0 of type triangle is inverted, |J| = -0.25
> [1]PETSC ERROR: See https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!Z4nwRjrsrMEicB_kYCgaYAZ-kDyLwUVzbEsc7URFCva6KyGkrF5e8yjb_GiisPeXrchhomiHO0uaDLPI91Szcc0$ 
> <https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!YJgdfNvYGp76m3zAsH07tAaJCaPnEyuyhZdGILGu2oyhW0RSJZeX4J8-IUCVNBupO7efr7Ju5zA_5ayjZ_YkwEeCuaawmeuG$>
> for trouble shooting.
> [1]PETSC ERROR: PETSc Release Version 3.24.0, unknown
> [1]PETSC ERROR: ./ex18 with 2 MPI process(es) and PETSC_ARCH
> arch-centos_kokkos on boltzmann2 by zhangc20 Mon Oct  6 14:00:48 2025
> [1]PETSC ERROR: Configure options: --with-cc=mpicc --with-cxx=mpicxx
> --with-fc=mpif90 --with-shared-libraries=1 --with-debugging=no
> --COPTFLAGS="-g -O2 -fPIC" --CXXOPTFLAGS="-g -O2 -fPIC" --FOPTFLAGS="-g -O2
> -fPIC" --with-cuda=1 --with-cuda-arch=86 --with-cudac=nvcc --with-kokkos=1
> --with-kokkos-dir=./../install/kokkos/install/ --with-kokkos-kernels=1
> --with-kokkos-kernels-dir=./../install/kokkos-kernels/install/
> --download-metis --download-parmetis --download-fblaslapack=1
> --download-triangle --with-make-np=8 PETSC_ARCH=arch-centos_kokkos
> [1]PETSC ERROR: #1 DMPlexCheckGeometry() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plex.c:9630
> [1]PETSC ERROR: #2 DMPlexCheck() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plex.c:9807
> [1]PETSC ERROR: #3 DMSetFromOptions_NonRefinement_Plex() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plexcreate.c:5121
> [1]PETSC ERROR: #4 DMSetFromOptions_Plex() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/impls/plex/plexcreate.c:5601
> [1]PETSC ERROR: #5 DMSetFromOptions() at
> /hdd1/dsmc/comet/comet/petsc/src/dm/interface/dm.c:907
> [1]PETSC ERROR: #6 CreateMesh() at ex18.c:811
> [1]PETSC ERROR: #7 main() at ex18.c:1527
> [1]PETSC ERROR: PETSc Option Table entries:
> [1]PETSC ERROR: -dm_plex_check_all 1 (source: command line)
> [1]PETSC ERROR: -dm_view ascii:dm_mesh.txt:ascii_info_detail (source:
> command line)
> [1]PETSC ERROR: -interpolate create (source: command line)
> [1]PETSC ERROR: ----------------End of Error Message -------send entire
> error message to petsc-maint at mcs.anl.gov----------
> Abort(62) on node 1 (rank 0 in comm 16): application called
> MPI_Abort(MPI_COMM_SELF, 62) - process 0
>
>
>
> Run script used:
>
> mpirun -np 2 ./ex18 -dm_plex_check_all 1 -dm_view
> ascii:dm_mesh.txt:ascii_info_detail -interpolate create
>
>
>
> Thanks,
>
> Chonglin
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251006/56fb0906/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 454644 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251006/56fb0906/attachment-0001.jpg>


More information about the petsc-users mailing list