[petsc-users] wrap MATMPIAIJ in MatShellSetOperation and use in SLEPc

Denis Davydov davydden at gmail.com
Mon Oct 13 12:16:10 CDT 2014


Dear all, 

I am solving a generalised eigenvalue problem 

    S \cdot v = a M \cdot v  (1)

using Krylov-Schur eigensolver with the shift-and-invert transformation.  
Now I would like to expand the problem to the case   

    [S + c^\ast \otimes c ] \cdot v = a M \cdot v      (2),

where “c” is some vector. 

As a first step, I was trying to “wrap" MATMPIAIJ matrix in the MatCreateShell() matrix 
with MatShellSetOperation() which then does multiplication. 
So far I do not add any action due to “c” (e.g. c = 0), but only aim to workout how to approach the problem.  
Unfortunately, when I use shift-and-invert, i hit some errors (below). 
In another test problem without shift-and-invert, it seems to be working fine (I am still testing). 
Supposedly, the user-defined matrices are not supported in full in SLEPc and the error is triggered. 
I am quite sure it is related to the usage shift-and-invert, but I don’t know implementation details to tell why is it the case. 

Is there any other way I could consider the problem (2) within SLEPc with shift-and-invert or 
do some additional tricks to make it work within MatCreateShell()? 

p.s. this problem arises from the density functional theory with non-local pseudo-potentials, S is hermitian.

Kind regards,
Denis 


— error —
[0]PETSC ERROR: No support for this operation for this object type!
[0]PETSC ERROR: Not written for this matrix type!
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.4.3, Oct, 15, 2013
[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: Configure options --prefix=/opt/gcc47-complex/petsc-3.4.3-complex PETSC_ARCH=darwin-release-c --with-mpi-dir=/opt/gcc47-complex/openmpi-1.6.5 --with-blas-lib=/opt/gcc47-complex/openblas-0.2.4/lib/libopenblas.dylib --with-lapack-lib=/opt/gcc47-complex/lapack-3.4.2/lib/liblapack.dylib --with-debugging=0 --with-x=0 --download-superlu_dist --download-metis --download-parmetis --with-clanguage=cxx --with-external-packages-dir=/opt/gcc47-complex/petsc_external_packages --with-scalar-type=complex
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: MatDuplicate() line 4061 in /petsc-3.4.3/src/mat/interface/matrix.c
[0]PETSC ERROR: STMatGAXPY_Private() line 359 in src/st/interface/stsolve.c
[0]PETSC ERROR: STSetUp_Sinvert() line 138 in src/st/impls/sinvert/sinvert.c
[0]PETSC ERROR: STSetUp() line 290 in src/st/interface/stsolve.c
[0]PETSC ERROR: EPSSetUp() line 215 in src/eps/interface/setup.c
[0]PETSC ERROR: EPSSolve() line 90 in src/eps/interface/solve.c


More information about the petsc-users mailing list