[petsc-users] Help with DMPlexCreateFromCellListParallelPetsc
Zhang, Chonglin
chonglin.zhang at und.edu
Mon Oct 6 14:39:22 CDT 2025
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!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.
[cid:image001.jpg at 01DC36CC.D62D6600]
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!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----------<mailto: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!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----------<mailto: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/d48f0a33/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 454644 bytes
Desc: image001.jpg
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251006/d48f0a33/attachment-0002.jpg>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ex18.c
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251006/d48f0a33/attachment-0001.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dm_mesh_wrong.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251006/d48f0a33/attachment-0001.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PETSc_DM.jpg
Type: image/jpeg
Size: 454644 bytes
Desc: PETSc_DM.jpg
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20251006/d48f0a33/attachment-0003.jpg>
More information about the petsc-users
mailing list