ex3.py Command Line Options

Issue #8 resolved
Kim Usi created an issue

Hello,

I'm trying to run ex3 with an options from command line, such as -eps_target, but I get the following error:

WARNING! There are options you set that were not used!
WARNING! could be spelling mistake, etc!
Option left: name:-eps_target value: 0.0

I also get something similar for other options I specify. It works for other codes and examples but not for ex3.py, and I'm not entirely sure why. Am I missing something?

Thanks, KIm

Comments (6)

  1. Jose E. Roman

    In order to set command-line options you should call eps.setFromOptions(). I will fix the examples where this is missing.

  2. Kim Usi reporter

    I have another problem. I am trying to follow these steps, but for ex3.py: http://www.grycap.upv.es/slepc/handson/handson5.html

    I get up to the very last part about using the option -st_pc_type jacobi, but I get the following error:

    [0] EPSSolve() line 116 in src/eps/interface/solve.c
    [0] EPSSolve_KrylovSchur_Symm() line 58 in src/eps/impls/krylov/krylovschur/ks-symm.c
    [0] EPSFullLanczos() line 186 in src/eps/impls/krylov/krylov.c
    [0] STApply() line 66 in src/st/interface/stsolve.c
    [0] STApply_Sinvert() line 39 in src/st/impls/sinvert/sinvert.c
    [0] STMatSolve() line 149 in src/st/interface/stsles.c
    [0] KSPSolve() line 441 in src/ksp/ksp/interface/itfunc.c
    [0] KSPSolve_GMRES() line 239 in src/ksp/ksp/impls/gmres/gmres.c
    [0] KSPInitialResidual() line 64 in src/ksp/ksp/interface/itres.c
    [0] KSP_PCApply() line 227 in src/ksp/ksp/interface//home/kim/petscComplex/petsc-3.4.4/include/petsc-private/kspimpl.h
    [0] PCApply() line 442 in src/ksp/pc/interface/precon.c
    [0] PCApply_Jacobi() line 264 in src/ksp/pc/impls/jacobi/jacobi.c
    [0] PCSetUp_Jacobi_NonSymmetric() line 239 in src/ksp/pc/impls/jacobi/jacobi.c
    [0] PCSetUp_Jacobi() line 158 in src/ksp/pc/impls/jacobi/jacobi.c
    [0] MatGetDiagonal() line 4116 in src/mat/interface/matrix.c
    [0] MatGetDiagonal_Shell() line 119 in src/st/interface/shellmat.c
    [0] MatGetDiagonal() line 4116 in src/mat/interface/matrix.c
    [0] MatGetDiagonal_Python() line 2510 in petsc4py-3.4/src/libpetsc4py/libpetsc4py.c
    [0]   
    [0] method getDiagonal()
    

    They also say this: "Note that this works because the MATOP_GET_DIAGONAL has been defined in our program", and I'm not sure what that means.

  3. Jose E. Roman

    slepc4py examples are not identical to SLEPc examples. The handson exercises are for SLEPc, you cannot just repeat the steps in slepc4py.

    ex3.py in slepc4py defines a shell matrix with only one operation ('mult' for the matrix-vector multiplication), but ex5.c in SLEPc defines a shell matrix with three operations ('mult', 'multtranspose', and 'getdiagonal'). You should add these also to the python example.

  4. Log in to comment