On Feb 26, 2013, at 9:54 PM, Dmitry Karpeev <
karpeev@mcs.anl.gov> wrote:
> Here's what I get with this simple example (source and makefile also attached):
>
>
> #include <petscksp.h>
>
> #undef __FUNCT__
> #define __FUNCT__ "main"
> int main(int argc,char **args)
> {
> KSP ksp;
> PetscErrorCode ierr;
> PetscInitialize(&argc,&args,(char*)0,(char*)0);
> ierr = KSPCreate(PETSC_COMM_WORLD, &ksp);CHKERRQ(ierr);
> ierr = KSPSetPCSide(ksp, PC_RIGHT);CHKERRQ(ierr);
> ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr);
> ierr = KSPDestroy(&ksp);CHKERRQ(ierr);
> PetscFinalize();
> }
>
>
> Then
>
> [hal3 Tue Feb 26 09:34 PM] ~/petsc/dev/c/src/ksp/ksp/examples/tutorials/tmp >./ex -ksp_type preonly -ksp_pc_side left
> [0]PETSC ERROR: --------------------- Error Message ------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type!
> [0]PETSC ERROR: KSP preonly does not support RIGHT!
> [0]PETSC ERROR: ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Development HG revision: 55699a42ce9360fb4641931ab7ec242cba302c58 HG Date: Mon Feb 25 22:15:44 2013 -0500
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages.
> [0]PETSC ERROR: ------------------------------------------------------------------------
> [0]PETSC ERROR: ./ex on a arch-gxx-real named hal3 by karpeev Tue Feb 26 21:37:13 2013
> [0]PETSC ERROR: Libraries linked from /home/karpeev/petsc/dev/c/arch-gxx-real/lib
> [0]PETSC ERROR: Configure run at Tue Feb 26 17:50:35 2013
> [0]PETSC ERROR: Configure options --PETSC_ARCH=arch-gxx-real --download-f-blas-lapack=1 --download-mpich=1 --with-cc=gcc --with-clanguage=C++ --with-cxx=g++ --with-dynamic-loading=1 --with-python=1 --with-scalar-type=real --with-shared-libraries=1
> [0]PETSC ERROR: ------------------------------------------------------------------------
> [0]PETSC ERROR: KSPSetUpNorms_Private() line 385 in /home/karpeev/petsc/dev/c/src/ksp/ksp/interface/itcreate.c
> [0]PETSC ERROR: KSPSetFromOptions() line 409 in /home/karpeev/petsc/dev/c/src/ksp/ksp/interface/itcl.c
> [0]PETSC ERROR: main() line 13 in ex.c
> application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
> [unset]: aborting job:
> application called MPI_Abort(MPI_COMM_WORLD, 56) - process 0
> [hal3 Tue Feb 26 09:37 PM] ~/petsc/dev/c/src/ksp/ksp/examples/tutorials/tmp >
>
> The problem seems to be this clause in KSPSetUpNorms_Private():
>
>
> if (ksp->normtype == KSP_NORM_DEFAULT && i == KSP_NORM_NONE && ksp->normsupporttable[i][j] <= 1) {
> continue; /* Skip because we don't want to default to no norms unless set by the KSP (preonly). */
>
>
> It is hit because of the code in KSPCreate_PREONLY() you quoted:
>
> ierr = KSPSetSupportedNorm(ksp,KSP_NORM_NONE,PC_LEFT,2);CHKERRQ(ierr); /* LEFT/RIGHT is arbitrary, so "support" both */
> ierr = KSPSetSupportedNorm(ksp,KSP_NORM_NONE,PC_RIGHT,1);CHKERRQ(ierr);
>
> The problem is that PC_RIGHT is preferred by KSP_NORM only with priority 1, which is too weak to overcome
> that "continue" clause above.