Slepc followed by Haydock solver

Deals with issues related to computation of optical spectra in reciprocal space: RPA, TDDFT, local field effects.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan

Post Reply
harrier_class
Posts: 29
Joined: Tue May 13, 2025 4:27 pm

Slepc followed by Haydock solver

Post by harrier_class » Mon Aug 17, 2026 10:01 am

Dear developors, maintainers, and fellow-users,

I have been working with adosrption systrem [nbnds =3600], for TDDFT in the reciprocal space using Yambo 5.0 [compiled with gcc-based compilers], I was using this command

Code: Select all

yambo -o b -k alda -y d 
However, with increasing band ranges, I see that its no longer possible to have full diagonalization of the matrix, so I switched to haydock solver.

Code: Select all

yambo -o b -k alda -y h 
Since, we would also like to have the excitonic analysis at the several peaks, now, I would also like to the claculation using Slepc solver. I tried the following:

Code: Select all

yambo -o b -k alda -y s
However, I dont see the input variables, [which I think is important to tell Slepc solver, which states to look out for]

Code: Select all

BSSNEig= 4
BSSEnTarget= 2.00 eV  


Can you please tell me if I am doing anything wrong in the process?

--
Best regards,
Vipui Kumar Ambasta
Vipul Kumar Ambasta
Doctoral Candidate
Friedrich Alexander Universitaet
Erlangen (Germany)

harrier_class
Posts: 29
Joined: Tue May 13, 2025 4:27 pm

Re: Slepc followed by Haydock solver

Post by harrier_class » Mon Aug 17, 2026 6:05 pm

Dear developers, maintainers, and fellow-users,

I figured out the problem. My current Yambo code was not compiled with the slepc support.

So, I updated the modules with petsc and slepc and changed the configure command to also have --enable-slepc-linalg

Code: Select all

module load gcc/11.5.0
#module load openmpi/4.1.3-gcc11.5.0
module load hdf5/1.14.5-gcc-ompi
module load netcdf-c/4.8.1-gcc-ompi
module load netcdf-fortran/4.6.1-gcc-ompi
module load mkl/2024.2.2
module load petsc/3.23.4-gcc11.5.0-openmpi-mkl
module load slepc/3.23.2-gcc11.5.0-openmpi-mkl
openmpi module is commented out, since petsc/3.23.4-gcc11.5.0-openmpi-mkl loads openmpi/4.1.8



Code: Select all

./configure \
  CC=gcc FC=gfortran F77=mpifort MPICC=mpicc MPIFC=mpifort MPIF77=mpifort \
  --with-blas-libs="-L${MKLROOT}/lib -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
  --with-lapack-libs="-L${MKLROOT}/lib -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
  --with-scalapack-libs="-L${MKLROOT}/lib -lmkl_scalapack_lp64" \
  --with-blacs-libs="-L${MKLROOT}/lib -lmkl_blacs_openmpi_lp64" \
  --with-fft-includedir="${MKLROOT}/include" \
  --with-fft-libs="-L${MKLROOT}/lib -Wl,--no-as-needed -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -lgomp -lpthread -lm -ldl" \
  --enable-par-linalg --enable-mpi --enable-open-mp --enable-msgs-comps --enable-time-profile --enable-memory-profile --enable-hdf5-par-io --enable-slepc-linalg


I get the following error

Code: Select all

   28 | #include <petsc/finclude/petscvec.h>
      |  1~~~~~~~~~~~~~~~~~~~~~~~~~~
Fatal Error: petsc/finclude/petscsys.h: No such file or directory
compilation terminated.
make[2]: *** [Makefile:177: mod_interfaces.o] Error 1
make[2]: Leaving directory '/home/woody/bccc/bccc128h/software/yambo_5.0_fritz_cpu_almalinux9_gcc_with_slepc/src/modules'
make[1]: *** [config/mk/actions/compile_yambo.mk:4: yambo] Error 2
make[1]: Leaving directory '/home/woody/bccc/bccc128h/software/yambo_5.0_fritz_cpu_almalinux9_gcc_with_slepc'
yambo build failed
Also, please find the config.log file attached.


Can you please help me troubleshoot?


--
Thanks and best regards,
Vipul
You do not have the required permissions to view the files attached to this post.
Vipul Kumar Ambasta
Doctoral Candidate
Friedrich Alexander Universitaet
Erlangen (Germany)

User avatar
Nicola Spallanzani
Posts: 109
Joined: Thu Nov 21, 2019 10:15 am

Re: Slepc followed by Haydock solver

Post by Nicola Spallanzani » Tue Aug 25, 2026 10:27 am

Dear Vipul,

I see several issues with the procedure you are following.

First of all, unfortunately, the PETSc/SLEPc version you are using is too recent. Yambo 5.0 supports PETSc/SLEPc only up to version 3.20. Yambo 5.3 supports up to version 3.22 by default, but with a patch that I am attaching you can extend the support up to version 3.24.

Another issue is that you are not actually linking the libraries, because you are not providing Yambo with the paths needed to find them. Loading the modules alone is not enough. More precisely, only BLAS, LAPACK, and HDF5 have a procedure that allows Yambo to detect them automatically; the other libraries do not.

So, most likely, you are not using the NetCDF libraries provided by the modules either. You should add paths such as:

Code: Select all

--with-hdf5-path=...
--with-netcdf-path=...
--with-netcdff-path=...
If you absolutely need to use Yambo 5.0, I would recommend letting Yambo compile the PETSc/SLEPc versions it expects. To do this, you only need to keep the `--enable-slepc-libnalg` flag without specifying the paths to the two libraries.

This is actually what you are already doing, but something else seems to be going wrong. It may be enough to simply avoid loading the PETSc/SLEPc modules before configuring Yambo.

There is also another important issue: PETSc/SLEPc must be compiled using the same precision as Yambo, i.e. single or double precision. The versions provided by the modules are almost certainly compiled in double precision. Therefore, letting Yambo build PETSc/SLEPc itself is probably still the best solution, as it will build them consistently with the Yambo configuration.

When you write back, in addition to the `config.log` file, please also send me the `report` file that you can find inside the `config` directory. The files inside the `log` directory would also be useful.

Best,
Nicola
You do not have the required permissions to view the files attached to this post.
Nicola Spallanzani, PhD
S3 Centre, Istituto Nanoscienze CNR and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu

Post Reply