[petsc-users] GAMG with PETSc

Gaetan Kenway gaetank at gmail.com
Thu Aug 11 19:16:55 CDT 2016


Hi

I'm attempting to try out using GAMG for a preconditioner for my
compressible CFD problem. However, I'm getting segfaults when trying to run
the code. The code is based on ksp ex23.c which is attached. It just reads
in two precomputed matrices (the actual jacobian and an approximate
jacobian used to build the PC) and solves with a RHS of ones.

My normal approach to solving the system is with ASM+ILU. With the
following options, everything works fine.

 mpirun -np 1 ./ex23  -ksp_monitor -ksp_type gmres -ksp_view -ksp_max_it
200 -mat_type mpibaij -ksp_gmres_restart 100 -pc_type asm \
-sub_ksp_type richardson -sub_ksp_max_it 2 -sub_pc_factor_levels 2
--ksp_pc_side right -sub_pc_factor_mat_ordering_type rcm \
-sub_ksp_pc_side right -info -log_summary > ASM.out

Now when I try to replace the PC with gamg and run the following:

 mpirun -np 1 ./ex23  -ksp_monitor -ksp_type fgmres -ksp_view -ksp_max_it
200 -mat_type mpibaij -ksp_gmres_restart 100 -pc_type gamg -info
-log_summary > GAMG.out

I just get a segfault. The backtrace from gdb is

[0] PCSetUp(): Setting up PC for first time
[0] PCSetUp_GAMG(): level 0) N=483840, n data rows=5, n data cols=5,
nnz/row (ave)=34, np=1

Program received signal SIGSEGV, Segmentation fault.
MatSetValues_MPIBAIJ (mat=0xc7e9e0, m=1, im=0x7fffffffccd0, n=1,
in=0x7fffffffccd4, v=0x7fffffffcd18, addv=ADD_VALUES) at
/home/gaetan/packages/petsc-3.7.3/src/mat/impls/baij/mpi/mpibaij.c:193
193  Mat_SeqBAIJ *a    = (Mat_SeqBAIJ*)(A)->data;
(gdb) bt
#0  MatSetValues_MPIBAIJ (mat=0xc7e9e0, m=1, im=0x7fffffffccd0, n=1,
in=0x7fffffffccd4, v=0x7fffffffcd18, addv=ADD_VALUES) at
/home/gaetan/packages/petsc-3.7.3/src/mat/impls/baij/mpi/mpibaij.c:193
#1  0x00007ffff6cfccae in MatSetValues (mat=0xc7e9e0, m=m at entry=1,
idxm=idxm at entry=0x7fffffffccd0, n=n at entry=1, idxn=idxn at entry=0x7fffffffccd4,
v=v at entry=0x7fffffffcd18, addv=addv at entry=ADD_VALUES)
    at /home/gaetan/packages/petsc-3.7.3/src/mat/interface/matrix.c:1190
#2  0x00007ffff723ce17 in PCGAMGCreateGraph (Amat=Amat at entry=0x8f6940,
a_Gmat=a_Gmat at entry=0x7fffffffcd70) at
/home/gaetan/packages/petsc-3.7.3/src/ksp/pc/impls/gamg/util.c:206
#3  0x00007ffff7231898 in PCGAMGGraph_AGG (pc=<optimized out>,
Amat=0x8f6940, a_Gmat=0x7fffffffce60) at
/home/gaetan/packages/petsc-3.7.3/src/ksp/pc/impls/gamg/agg.c:904
#4  0x00007ffff7228e87 in PCSetUp_GAMG (pc=0xc4f800) at
/home/gaetan/packages/petsc-3.7.3/src/ksp/pc/impls/gamg/gamg.c:570
#5  0x00007ffff7172d65 in PCSetUp (pc=0xc4f800) at
/home/gaetan/packages/petsc-3.7.3/src/ksp/pc/interface/precon.c:968
#6  0x00007ffff7293c26 in KSPSetUp (ksp=ksp at entry=0xc4e2b0) at
/home/gaetan/packages/petsc-3.7.3/src/ksp/ksp/interface/itfunc.c:390
#7  0x00007ffff7294282 in KSPSolve (ksp=0xc4e2b0, b=0xc4cda0, x=0x8ec9d0)
at /home/gaetan/packages/petsc-3.7.3/src/ksp/ksp/interface/itfunc.c:599
#8  0x0000000000401209 in main (argc=15, args=0x7fffffffd548) at
/home/gaetan/packages/petsc-3.7.3/src/ksp/ksp/examples/tutorials/ex23.c:62
(gdb)

Any thoughts on what might be going wrong?

Thanks,

Gaetan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160811/3001d915/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.log
Type: text/x-log
Size: 7883882 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160811/3001d915/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ex23.c
Type: text/x-csrc
Size: 2544 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160811/3001d915/attachment-0001.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ASM.out
Type: application/octet-stream
Size: 45582 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160811/3001d915/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GAMG.out
Type: application/octet-stream
Size: 5727 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160811/3001d915/attachment-0003.obj>


More information about the petsc-users mailing list