Skip to content

Commit

Permalink
Version 5.2.0, Revision 23308, Hash 273bb95
Browse files Browse the repository at this point in the history
MODIFIED *  configure include/version/version.m4 lib/slepc/Makefile.loc bse/K_diago_driver.F bse/K_stored_in_a_nest_matrix.F linear_algebra/MATRIX_slepc.F

NEW *

Changes:
- [yambo] Commented call to Slepc get bse type, otherwise it always
  overwirets what in input

Patch sent by:  Davide Sangalli <[email protected]>
  • Loading branch information
sangallidavide committed Jul 31, 2024
1 parent 273bb95 commit 40ea57b
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 51 deletions.
32 changes: 19 additions & 13 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for Yambo 5.2.0 r.23287 h.e9ab2f86a2.
# Generated by GNU Autoconf 2.71 for Yambo 5.2.0 r.23308 h.273bb95c93.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -610,8 +610,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Yambo'
PACKAGE_TARNAME='yambo'
PACKAGE_VERSION='5.2.0 r.23287 h.e9ab2f86a2'
PACKAGE_STRING='Yambo 5.2.0 r.23287 h.e9ab2f86a2'
PACKAGE_VERSION='5.2.0 r.23308 h.273bb95c93'
PACKAGE_STRING='Yambo 5.2.0 r.23308 h.273bb95c93'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -690,6 +690,8 @@ MPI_check
LIBXC_check
YPY_check
YDB_check
SLEPC_info
PETSC_info
SLEPC_check
PETSC_check
SLK_check
Expand Down Expand Up @@ -1604,7 +1606,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Yambo 5.2.0 r.23287 h.e9ab2f86a2 to adapt to many kinds of systems.
\`configure' configures Yambo 5.2.0 r.23308 h.273bb95c93 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1670,7 +1672,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Yambo 5.2.0 r.23287 h.e9ab2f86a2:";;
short | recursive ) echo "Configuration of Yambo 5.2.0 r.23308 h.273bb95c93:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1882,7 +1884,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Yambo configure 5.2.0 r.23287 h.e9ab2f86a2
Yambo configure 5.2.0 r.23308 h.273bb95c93
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2511,7 +2513,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Yambo $as_me 5.2.0 r.23287 h.e9ab2f86a2, which was
It was created by Yambo $as_me 5.2.0 r.23308 h.273bb95c93, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3269,8 +3271,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
SVERSION="5"
SSUBVERSION="2"
SPATCHLEVEL="0"
SREVISION="23287"
SHASH="e9ab2f86a2"
SREVISION="23308"
SHASH="273bb95c93"



Expand Down Expand Up @@ -15604,19 +15606,21 @@ if test "$internal_blacs" = "yes" ; then
fi
#
PETSC_check="-"
PETSC_info=""
if test "$internal_petsc" = "yes" ; then
if test "$compile_petsc" = "yes" ; then PETSC_check="C"; fi
if test "$compile_petsc" = "no" ; then PETSC_check="I"; fi
if ! test "$with_petsc_branch" = "none"; then PETSC_LIBS="$PETSC_LIBS (git branch $with_petsc_branch)"; fi
if ! test "$with_petsc_branch" = "none"; then PETSC_info="(git branch $with_petsc_branch)"; fi
elif test "$enable_petsc" = "yes" ; then
PETSC_check="E"
fi
#
SLEPC_check="-"
SLEPC_info=""
if test "$internal_slepc" = "yes" ; then
if test "$compile_slepc" = "yes" ; then SLEPC_check="C"; fi
if test "$compile_slepc" = "no" ; then SLEPC_check="I"; fi
if ! test "$with_slepc_branch" = "none"; then SLEPC_LIBS="$SLEPC_LIBS (git branch $with_slepc_branch)"; fi
if ! test "$with_slepc_branch" = "none"; then SLEPC_info="(git branch $with_slepc_branch)"; fi
elif test "$enable_slepc" = "yes" ; then
SLEPC_check="E"
fi
Expand Down Expand Up @@ -15696,6 +15700,8 @@ fi





#


Expand Down Expand Up @@ -16606,7 +16612,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Yambo $as_me 5.2.0 r.23287 h.e9ab2f86a2, which was
This file was extended by Yambo $as_me 5.2.0 r.23308 h.273bb95c93, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -16670,7 +16676,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
Yambo config.status 5.2.0 r.23287 h.e9ab2f86a2
Yambo config.status 5.2.0 r.23308 h.273bb95c93
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Expand Down
6 changes: 3 additions & 3 deletions include/version/version.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
AC_INIT(Yambo, 5.2.0 r.23286 h.86fcda4c45, [email protected])
AC_INIT(Yambo, 5.2.0 r.23308 h.273bb95c93, [email protected])
SVERSION="5"
SSUBVERSION="2"
SPATCHLEVEL="0"
SREVISION="23286"
SHASH="86fcda4c45"
SREVISION="23308"
SHASH="273bb95c93"
AC_SUBST(SVERSION)
AC_SUBST(SSUBVERSION)
AC_SUBST(SPATCHLEVEL)
Expand Down
2 changes: 1 addition & 1 deletion lib/slepc/Makefile.loc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ compile: uncompress configure
install: uncompress configure compile
@if ! test -f installed.stamp ; then \
echo "\t[$(PACKAGE)] installation"; \
( cd $(PACKAGE); $(make) -j1 SLEPC_DIR=$(PWD)/$(PACKAGE) PETSC_DIR=$(LIBPATH) install >> ${compdir}/log/compile_$(PACKAGE).log 2>&1 ); \
( cd $(PACKAGE); $(make) -j1 SLEPC_DIR=$(PWD)/$(PACKAGE) PETSC_DIR=$(LIBPATH) install >> ${compdir}/log/install_$(PACKAGE).log 2>&1 ); \
touch installed.stamp; \
fi

Expand Down
24 changes: 13 additions & 11 deletions src/bse/K_diago_driver.F
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ subroutine K_diago_driver(iq,W,X_static)
use stderr, ONLY:intc
use BS, ONLY:BS_K_coupling,BS_H_dim,BS_K_dim,BS_perturbative_SOC,&
& BS_res_ares_n_mat,l_BS_optics,l_BS_dichroism !,BS_Blocks_symmetrize_K,&
use BS_solvers, ONLY:io_BSS_diago,BSS_perturbative_width,BSS_mode,&
use BS_solvers, ONLY:io_BSS_diago,BSS_perturbative_width,BSS_mode,BSS_slepc_double_grp,&
& BSS_write_eig_2_db,BSS_eh_W,BS_mat,BSS_n_eig,BS_E
use X_m, ONLY:X_t,X_OUTPUT_driver
use electrons, ONLY:n_sp_pol,n_spinor
Expand All @@ -41,19 +41,19 @@ subroutine K_diago_driver(iq,W,X_static)
use timing_m, ONLY:timing
#if defined _SLEPC && !defined _NL
use interfaces, ONLY:MATRIX_slepc
!
use petscmat
use slepceps
use slepcepsdef
use petscmatdef
!
use BS_solvers, ONLY:BSS_slepc_approach,BSS_slepc_matrix_format,BSS_slepc_custom,&
& Slepc_v,BS_HAYVEC_free
use BS_solvers, ONLY:BSS_slepc_approach,BSS_slepc_matrix_format,BSS_slepc_custom,&
& Slepc_v,BS_HAYVEC_free
#endif
use BS, ONLY:l_BS_kerr,l_BS_magnons,l_BS_photolum,l_BS_ares_from_res
use MAGNONS, ONLY:BSS_MAGN_free
use PHOTOLUM, ONLY:BSS_PL_free
!
#if defined _SLEPC && !defined _NL
use slepceps, ONLY:SlepcInitialize
use petscmat, ONLY:PETSC_NULL_CHARACTER
use petscmatdef, ONLY:tMat
#endif
!
#include<memory.h>
!
type(w_samp) :: W
Expand All @@ -69,6 +69,7 @@ subroutine K_diago_driver(iq,W,X_static)
! Slepc specific
!
#if defined _SLEPC && !defined _NL
! Mat becomes type(tMat) after source is pre-processed
Mat :: slepc_mat
PetscErrorCode :: ierr
#endif
Expand Down Expand Up @@ -189,14 +190,15 @@ subroutine K_diago_driver(iq,W,X_static)
! 1. Here we will define a PetscShell matrix and define the matrix-vector multiplication
! using the K_multiply_by_V function used in the Haydock method
if (index(BSS_slepc_matrix_format,"shell")>0) then
BSS_slepc_custom=(BSS_slepc_matrix_format=="shell").and.BS_K_coupling
BSS_slepc_custom=(BSS_slepc_matrix_format=="shell").and.BS_K_coupling.and..not.BSS_slepc_double_grp
call K_shell_matrix(i_BS_mat,slepc_mat)
! 2. Here we create a distributed PETSC matrix from the BS_blks
else if (BSS_slepc_matrix_format=="explicit") then
if (BS_K_coupling.and.l_BS_ares_from_res) then
! 2.1. With memory optimization using nest matrix (only possible for the coupling case)
call K_stored_in_a_nest_matrix(i_BS_mat,.FALSE.,slepc_mat)
BSS_slepc_custom=.TRUE.
BSS_slepc_custom=.not.BSS_slepc_double_grp
!BSS_slepc_nested=.TRUE. ! to replace BSS_slepc_custom (?)
else
! 2.2. Explicit PETSc matrix for the rest of the cases
call K_stored_in_a_slepc_matrix(i_BS_mat,slepc_mat)
Expand Down
19 changes: 10 additions & 9 deletions src/bse/K_stored_in_a_nest_matrix.F
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,19 @@ subroutine K_stored_in_a_nest_matrix(i_BS_mat,nest_debug,slepc_mat)
! Folded spectrum
!
call MatCreateBSE(R,C,slepc_mat,ierr);
!
else
!
! Nested matrix
!
! Create the two shell submatrices and define the required operations
!
call MatCreateShell(PETSC_COMM_WORLD,PETSC_DECIDE,PETSC_DECIDE,SL_H_dim/2,SL_H_dim/2,0,RT,ierr)
if (have_cuda) then
#ifdef PETSC_HAVE_CUDA
call MatSetVecType(RT,VECCUDA,ierr)
#endif
if (have_cuda) then
call MatSetVecType(RT,VECCUDA,ierr)
endif
#endif
call MatShellSetOperation(RT,MATOP_GET_DIAGONAL,RT_get_diagonal,ierr)
call MatShellSetOperation(RT,MATOP_MULT,RT_mat_mult,ierr)
call MatShellSetOperation(RT,MATOP_MULT_TRANSPOSE,RT_mat_mult_transpose,ierr)
Expand All @@ -185,11 +186,11 @@ subroutine K_stored_in_a_nest_matrix(i_BS_mat,nest_debug,slepc_mat)
call PetscPopErrorHandler(ierr)
!
call MatCreateShell(PETSC_COMM_WORLD,PETSC_DECIDE,PETSC_DECIDE,SL_H_dim/2,SL_H_dim/2,0,CHT,ierr)
if (have_cuda) then
#ifdef PETSC_HAVE_CUDA
call MatSetVecType(CHT,VECCUDA,ierr)
#endif
if (have_cuda) then
call MatSetVecType(CHT,VECCUDA,ierr)
endif
#endif
call MatShellSetOperation(CHT,MATOP_GET_DIAGONAL,CHT_get_diagonal,ierr)
call MatShellSetOperation(CHT,MATOP_MULT,CHT_mat_mult,ierr)
call MatShellSetOperation(CHT,MATOP_MULT_TRANSPOSE,CHT_mat_mult_transpose,ierr)
Expand All @@ -205,11 +206,11 @@ subroutine K_stored_in_a_nest_matrix(i_BS_mat,nest_debug,slepc_mat)
matArray(4) = RT
itwo = 2
call MatCreateNest(PETSC_COMM_WORLD,itwo,PETSC_NULL_INTEGER,itwo,PETSC_NULL_INTEGER,matArray,slepc_mat,ierr)
if (have_cuda) then
#ifdef PETSC_HAVE_CUDA
call MatSetVecType(slepc_mat,VECCUDA,ierr)
#endif
if (have_cuda) then
call MatSetVecType(slepc_mat,VECCUDA,ierr)
endif
#endif
endif
!
end subroutine K_stored_in_a_nest_matrix
Expand Down
44 changes: 30 additions & 14 deletions src/linear_algebra/MATRIX_slepc.F
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,14 @@ subroutine MATRIX_slepc(M_slepc,l_target_energy,n_eig,V_right,V_left,E_real,E_cm
! * Jacobi-Davidson: EPSJD, NOT WORKING WITH KSP PREONLY
! STPPRECOND + KSPCG SUPER-SLOW + PCJACOBY super slow
!
! Default
! Default Krylov-Schur used in case input is mispelled
epskind=EPSKRYLOVSCHUR
! From user
if(BSS_slepc_approach=="Krylov-Schur") epskind=EPSKRYLOVSCHUR
if(BSS_slepc_approach=="Generalized-Davidson") epskind=EPSGD
if(BSS_slepc_approach=="Jacobi-Davidson") epskind=EPSJD
!if(BSS_slepc_approach=="Scalapack") epskind=EPSSCALAPACK
!if(BSS_slepc_approach=="ELPA") epskind=EPSELPA
! In case input is mispelled fallback to Krylov-Schur
if (epskind==EPSKRYLOVSCHUR) BSS_slepc_approach="Krylov-Schur"
if(index(BSS_slepc_approach,"Krylov-Schur")>0) epskind=EPSKRYLOVSCHUR
if(index(BSS_slepc_approach,"Generalized-Davidson")>0) epskind=EPSGD
if(index(BSS_slepc_approach,"Jacobi-Davidson")>0) epskind=EPSJD
!if(index(BSS_slepc_approach,"Scalapack")>0) epskind=EPSSCALAPACK
!if(index(BSS_slepc_approach,"ELPA")>0) epskind=EPSELPA
!
if (.not. (epskind==EPSKRYLOVSCHUR .or. epskind==EPSGD .or. epskind==EPSJD )) then
call error("wrong slepc approach in input "//trim(BSS_slepc_approach))
Expand Down Expand Up @@ -234,15 +232,33 @@ subroutine MATRIX_slepc(M_slepc,l_target_energy,n_eig,V_right,V_left,E_real,E_cm
!Set monitor
call EPSMonitorSet(eps,MyEPSMonitor,0,PETSC_NULL_FUNCTION,ierr)
!
! Load eps from command line options. It overwrites input file
call EPSSetFromOptions(eps,ierr)
!
if(present(V_left).and.BSS_slepc_custom.and.epskind==EPSKRYLOVSCHUR) then
call EPSKrylovSchurGetBSEType(eps,epsbsetype,ierr)
if(epsbsetype==EPS_KRYLOVSCHUR_BSE_SHAO) BSS_slepc_approach=trim(BSS_slepc_approach)//", Shao"
if(epsbsetype==EPS_KRYLOVSCHUR_BSE_GRUNING) BSS_slepc_approach=trim(BSS_slepc_approach)//", Gruning"
if(epsbsetype==EPS_KRYLOVSCHUR_BSE_SYMPLECTIC) BSS_slepc_approach=trim(BSS_slepc_approach)//", Symplectic"
else
BSS_slepc_approach=trim(BSS_slepc_approach)//"+NonHermitian"
! Default Gruning used in case input is mispelled or not set
epsbsetype=EPS_KRYLOVSCHUR_BSE_SHAO
! From user
if(index(BSS_slepc_approach,"Shao")>0) epsbsetype=EPS_KRYLOVSCHUR_BSE_SHAO
if(index(BSS_slepc_approach,"Gruning")>0) epsbsetype=EPS_KRYLOVSCHUR_BSE_GRUNING
!if(index(BSS_slepc_approach,"Symplectic")>0) epsbsetype=EPS_KRYLOVSCHUR_BSE_SYMPLECTIC ! To be replaced
if(index(BSS_slepc_approach,"Projected")>0) epsbsetype=EPS_KRYLOVSCHUR_BSE_PROJECTEDBSE ! New replacement
! Eventially load epsbsetype from command line options. It overwrites input file
!call EPSKrylovSchurGetBSEType(eps,epsbsetype,ierr)
endif
!
! Fix the BSS_slepc_approach string
if (epskind==EPSKRYLOVSCHUR) BSS_slepc_approach="Krylov-Schur"
!
if(present(V_left)) then
if(BSS_slepc_custom.and.epskind==EPSKRYLOVSCHUR) then
if(epsbsetype==EPS_KRYLOVSCHUR_BSE_SHAO) BSS_slepc_approach=trim(BSS_slepc_approach)//"+Shao"
if(epsbsetype==EPS_KRYLOVSCHUR_BSE_GRUNING) BSS_slepc_approach=trim(BSS_slepc_approach)//"+Gruning"
!if(epsbsetype==EPS_KRYLOVSCHUR_BSE_SYMPLECTIC) BSS_slepc_approach=trim(BSS_slepc_approach)//"+Symplectic" !To be replaced
if(epsbsetype==EPS_KRYLOVSCHUR_BSE_PROJECTEDBSE) BSS_slepc_approach=trim(BSS_slepc_approach)//"+ProjectedBSE" ! New replacement
else
BSS_slepc_approach=trim(BSS_slepc_approach)//"+NonHermitian"
endif
endif
!
call msg( 'sr', '[SLEPC] Approach ',BSS_slepc_approach)
Expand Down

0 comments on commit 40ea57b

Please sign in to comment.