[petsc-users] Problems about Block Jocabi and Matrix-Free Method in SNES

Yingjie Wu yjwu16 at gmail.com
Mon Oct 8 22:32:37 CDT 2018


Dear Petsc developer:
Hi,

I've been studying Petsc recently about Precontioner and Metrix-Free, and I
have some questions that puzzle me.

1. I want to test block Jacobi preconditioner, so I chose
/snes/example/tutorial/ex3.c as an example. According to the reference in
the example, the input parameters are:
mpiexec -n 8./ex3 -nox -n 10000 -ksp_type fgmres -pc_type bjacobi
-pc_bjacobi_blocks 4 -sub_ksp_type gmres -sub_ksp_max_it 3 -post_setsubksp
-sub_ksp_rtol 1.e-16
I want to export each block of KSP and PC information :
  -snes_view -ksp_view
However, the procedure is wrong and the wrong information is as follows:

       [0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: Arguments must have same communicators
[0]PETSC ERROR: Different communicators in the two objects: Argument # 1
and 2 flag 3
[0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[2]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[2]PETSC ERROR: [3]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[3]PETSC ERROR: Arguments must have same communicators
[3]PETSC ERROR: [6]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[6]PETSC ERROR: Arguments must have same communicators
[6]PETSC ERROR: Different communicators in the two objects: Argument # 1
and 2 flag 3
[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[7]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[7]PETSC ERROR: Arguments must have same communicators
[7]PETSC ERROR: Different communicators in the two objects: Argument # 1
and 2 flag 3
[7]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[7]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble
shooting.
[0]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[0]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
Mon Oct  8 22:35:34 2018
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-mpich --download-fblaslapack
[0]PETSC ERROR: #1 KSPView() line 118 in
/home/yjwu/petsc-3.10.1/src/ksp/ksp/interface/itcreate.c
[0]PETSC ERROR: #2 PCView_BJacobi() line 232 in
/home/yjwu/petsc-3.10.1/src/ksp/pc/impls/bjacobi/bjacobi.c
[0]PETSC ERROR: #3 PCView() line 1651 in
/home/yjwu/petsc-3.10.1/src/ksp/pc/interface/precon.c
[1]PETSC ERROR: Arguments must have same communicators
[1]PETSC ERROR: Different communicators in the two objects: Argument # 1
and 2 flag 3
[1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[1]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[1]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
Mon Oct  8 22:35:34 2018
[1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-mpich --download-fblaslapack
[1]PETSC ERROR: #1 KSPView() line 118 in
/home/yjwu/petsc-3.10.1/src/ksp/ksp/interface/itcreate.c
Arguments must have same communicators
[2]PETSC ERROR: Different communicators in the two objects: Argument # 1
and 2 flag 3
[2]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.

If I want to get the information of KSP and PC in each block, what should I
do?

2. There is a requirement in my program to use Matrix-Free method to
approximate Jacobian matrix by finite difference of residual function in
solving nonlinear equations. But I'll also provide an analytic( incomplete,
some terms are missing or approximate) for preconditioning. Because my
problem is about a large set of equations composed of several physical
fields, I want to use block Jacobian precondition for each subfield(block),
and ILU sub_pc for each subfield. After reading the Users'Guide, I found
that using - snex_mf_operator can do the above, so I added:
 - snes_mf_operator
after the example above. However, the procedure is wrong and does not seem
to support this.
 The wrong information is:

   [1]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[2]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[2]PETSC ERROR: No support for this operation for this object type
[2]PETSC ERROR: Mat type mffd
[2]PETSC ERROR: [3]PETSC ERROR: [4]PETSC ERROR: --------------------- Error
Message --------------------------------------------------------------
[4]PETSC ERROR: No support for this operation for this object type
[4]PETSC ERROR: Mat type mffd
[4]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[4]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[6]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[6]PETSC ERROR: No support for this operation for this object type
[6]PETSC ERROR: Mat type mffd
[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[6]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[6]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
Mon Oct  8 23:01:57 2018
[6]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-mpich --download-fblaslapack
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: No support for this operation for this object type
[0]PETSC ERROR: Mat type mffd
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[0]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
Mon Oct  8 23:01:57 2018
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-mpich --download-fblaslapack
[0]PETSC ERROR: #1 MatSetValues() line 1330 in
/home/yjwu/petsc-3.10.1/src/mat/interface/matrix.c
[1]PETSC ERROR: No support for this operation for this object type
[1]PETSC ERROR: Mat type mffd
[1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.

If I want to implement matrix-free and block jacobi precondition in my
program, what do I need to pay attention or add ?

The second question is very important for my research and I hope to get
your answer.

Thanks,
Yingjie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20181009/36de62f5/attachment-0001.html>


More information about the petsc-users mailing list