[petsc-users] [SLEPc] generalized symmetric eigensystem

Patrick Alken patrick.alken at geomag.info
Thu Aug 4 22:04:31 CDT 2022


I am trying to solve a generalized symmetric eigensystem problem using 
SLEPc, and I am getting much different eigenvalues compared with the 
dense LAPACK solver DSYGVD. I have attached a minimal working example 
(MWE). The code relies on the external libraries GSL, Lapack and Lapacke.

The matrices (A,B) come from discretizing the Laplacian in spherical 
coordinates using a radial basis function method. Here are the 
eigenvalues computed by the dense LAPACK solver:

=== LAPACK eigenvalues ===
eval(0) = 1.309567289750e+00
eval(1) = 1.648674331144e+00
eval(2) = 1.709879393690e+00
eval(3) = 1.709879393690e+00
eval(4) = 2.142210251638e+00
eval(5) = 2.142210251638e+00
eval(6) = 2.145726457896e+00
eval(7) = 2.216526311324e+00
eval(8) = 2.216526311324e+00
eval(9) = 2.695837030236e+00


Here are the eigenvalues computed by SLEPc, using the command:

$ ./mwe -eps_nev 10 -eps_smallest_magnitude -eps_tol 1e-8

Number of requested eigenvalues: 10
  Linear eigensolve converged (10 eigenpairs) due to CONVERGED_TOL; 
iterations 196
  ---------------------- --------------------
             k             ||Ax-kBx||/||kx||
  ---------------------- --------------------
         0.094520                906.031
         0.177268                363.291
         1.324501                61.9577
         1.786472                35.7082
         2.187857                32.8364
        -2.886905                27.7314
         2.899206                24.2224
         4.195222                20.3007
         4.787192                12.8346
         7.221589                9.58513
  ---------------------- --------------------

As we can see, the results are quite different than LAPACK and the error 
norms in the right column are quite large. Using a stricter tolerance 
(eps_tol) does not seem to help. Can anyone suggest how to diagnose and 
fix the problem?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: laplace3d.c
Type: text/x-csrc
Size: 15082 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220804/0333098a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: le_laplace3d.h
Type: text/x-chdr
Size: 1045 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220804/0333098a/attachment-0001.bin>
-------------- next part --------------
default: mwe

include ${SLEPC_DIR}/lib/slepc/conf/slepc_common

lib_dir = /home/palken/usr/lib
common_libs = -L${lib_dir} ${lib_dir}/libgsl.a -lm ${lib_dir}/liblapacke.a ${lib_dir}/liblapack.a

OBJECTS = mwe.o laplace3d.o

mwe: ${OBJECTS}
	${CLINKER} -o mwe ${OBJECTS} ${SLEPC_EPS_LIB} ${common_libs}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mwe.c
Type: text/x-csrc
Size: 3374 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20220804/0333098a/attachment-0002.bin>


More information about the petsc-users mailing list