[petsc-users] MatPreallocatorPreallocate segfault with PETSC 3.16
Marius Buerkle
mbuerkle at web.de
Mon Jan 24 03:33:47 CST 2022
Hi,
I try to use MatPreallocatorPreallocate to allocate a MATMPIAIJ matrix A . I define the MATPREALLOCATOR preM with MatSetValues and then call MatPreallocatorPreallocate to get A. This works on the first call to MatPreallocatorPreallocate, but if I call MatPreallocatorPreallocate again with the same preM to get another matrix B then I get a segfault, although the program continues to run (see below). It worked with PETSC 3.15 but with 3.16 I stopped working.
When I check mat_info_nz_allocated and mat_info_nz_used for the allocated matrix it looks correct for the first call, but on the second call mat_info_nz_used is 0. I also attached a minimal example.
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Null argument, when expecting valid pointer
[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Null Pointer: Parameter # 1
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: [1]PETSC ERROR: Null argument, when expecting valid pointer
[1]PETSC ERROR: Petsc Development GIT revision: v3.16.3-686-g5e81a90 GIT Date: 2022-01-23 05:13:26 +0000
[0]PETSC ERROR: ./prem_test on a named cd001 by cdfmat_marius Mon Jan 24 18:21:17 2022
[0]PETSC ERROR: Null Pointer: Parameter # 1
[1]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[1]PETSC ERROR: Configure options --prefix=/home/cdfmat_marius/prog/petsc/petsc_main_dbg --with-scalar-type=complex --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpiicc --COPTFLAGS="-g -traceback" --CXX=mpiicpc --CXXOPTFLAGS="-g -traceback" --FC=mpiifort --FOPTFLAGS="-g -traceback" --with-mpi=1 --with-x=0 --with-cuda=0 --download-parmetis=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.parmetis.tar.gz --download-parmetis-commit=HEAD --download-metis=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.metis.tar.gz --download-metis-commit=HEAD --download-slepc=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.slepc_main.tar.gz --download-slepc-commit=HEAD --download-superlu_dist=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.superlu_dist.tar.gz --download-superlu_dist-commit=HEAD --download-mumps=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.mumps.tar.gz --download-mumps-commit=HEAD --download-hypre=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.hypre.tar.gz --download-hypre-commit=HEAD --download-hwloc=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/hwloc-2.5.0.tar.gz --download-sowing=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.sowing.tar.gz --download-elemental=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.elemental.tar.gz --download-elemental-commit=HEAD --download-make=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/make-4.2.1-6.fc28.tar.gz --download-ptscotch=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.ptscotch.tar.gz --download-ptscotch-commit=HEAD --with-openmp=0 --with-pthread=0 --with-cxx-dialect=c++11 --with-debugging=1 --with-cuda=0 --with-cudac=0 --with-valgrind=0 --with-blaslapack-lib="-mkl=sequential -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl" --with-scalapack-lib="-mkl=sequential -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl" --with-mkl_pardiso-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl --with-mkl_cpardiso-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl --with-mkl_sparse-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl --with-mkl_sparse_optimize-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl
[0]PETSC ERROR: Petsc Development GIT revision: v3.16.3-686-g5e81a90 GIT Date: 2022-01-23 05:13:26 +0000
[1]PETSC ERROR: ./prem_test on a named cd001 by cdfmat_marius Mon Jan 24 18:21:17 2022
[1]PETSC ERROR: #1 PetscHSetIJGetSize() at /home/cdfmat_marius/prog/petsc/git/petsc_main/include/petsc/private/hashsetij.h:13
[0]PETSC ERROR: #2 MatPreallocatorPreallocate_Preallocator() at /home/cdfmat_marius/prog/petsc/git/petsc_main/src/mat/impls/preallocator/matpreallocator.c:165
[0]PETSC ERROR: #3 MatPreallocatorPreallocate() at /home/cdfmat_marius/prog/petsc/git/petsc_main/src/mat/impls/preallocator/matpreallocator.c:234
Configure options --prefix=/home/cdfmat_marius/prog/petsc/petsc_main_dbg --with-scalar-type=complex --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpiicc --COPTFLAGS="-g -traceback" --CXX=mpiicpc --CXXOPTFLAGS="-g -traceback" --FC=mpiifort --FOPTFLAGS="-g -traceback" --with-mpi=1 --with-x=0 --with-cuda=0 --download-parmetis=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.parmetis.tar.gz --download-parmetis-commit=HEAD --download-metis=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.metis.tar.gz --download-metis-commit=HEAD --download-slepc=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.slepc_main.tar.gz --download-slepc-commit=HEAD --download-superlu_dist=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.superlu_dist.tar.gz --download-superlu_dist-commit=HEAD --download-mumps=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.mumps.tar.gz --download-mumps-commit=HEAD --download-hypre=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.hypre.tar.gz --download-hypre-commit=HEAD --download-hwloc=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/hwloc-2.5.0.tar.gz --download-sowing=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.sowing.tar.gz --download-elemental=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.elemental.tar.gz --download-elemental-commit=HEAD --download-make=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/make-4.2.1-6.fc28.tar.gz --download-ptscotch=/home/cdfmat_marius/prog/petsc/git/petsc_main/externalpackages/git.ptscotch.tar.gz --download-ptscotch-commit=HEAD --with-openmp=0 --with-pthread=0 --with-cxx-dialect=c++11 --with-debugging=1 --with-cuda=0 --with-cudac=0 --with-valgrind=0 --with-blaslapack-lib="-mkl=sequential -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl" --with-scalapack-lib="-mkl=sequential -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lpthread -lm -ldl" --with-mkl_pardiso-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl --with-mkl_cpardiso-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl --with-mkl_sparse-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl --with-mkl_sparse_optimize-dir=/home/appli/intel/compilers_and_libraries_2020.4.304/linux/mkl
[1]PETSC ERROR: #1 PetscHSetIJGetSize() at /home/cdfmat_marius/prog/petsc/git/petsc_main/include/petsc/private/hashsetij.h:13
[1]PETSC ERROR: #2 MatPreallocatorPreallocate_Preallocator() at /home/cdfmat_marius/prog/petsc/git/petsc_main/src/mat/impls/preallocator/matpreallocator.c:165
[1]PETSC ERROR: #3 MatPreallocatorPreallocate() at /home/cdfmat_marius/prog/petsc/git/petsc_main/src/mat/impls/preallocator/matpreallocator.c:234
Best and Thanks,
Marius
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prem_test.tar.gz
Type: application/octet-stream
Size: 2373 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220124/6116c5b4/attachment.obj>
More information about the petsc-users
mailing list