Skip to content

Commit

Permalink
Version 5.2.0, Revision 23950, Hash 679093e
Browse files Browse the repository at this point in the history
MODIFIED *  config/m4/gpu.m4 config/setup.in configure include/version/version.m4 lib/petsc/Makefile.loc lib/slepc/Makefile.loc bse/K_stored_in_a_nest_matrix.F bse/K_stored_in_a_slepc_matrix.F

Changes:
- [yambo] Small changes to slepc gpu porting related coding

Patch sent by:  Davide Sangalli <[email protected]>
  • Loading branch information
sangallidavide committed Dec 11, 2024
1 parent 679093e commit 04bbd27
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 23 deletions.
2 changes: 2 additions & 0 deletions config/m4/gpu.m4
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ if test x"$enable_cuda_fortran" != "xno" ; then
# Flags to be passed to the devicexlib library
#
DEVXLIB_FLAGS="--enable-openmp --enable-cuda-fortran --with-cuda-cc=${with_cuda_cc} --with-cuda-runtime=${with_cuda_runtime}"
PETSC_FLAGS="--with-cuda"
#
case "${FCVERSION}" in
*nvfortran*)
Expand Down Expand Up @@ -295,6 +296,7 @@ AC_SUBST(GPU_LIBS)
AC_SUBST(GPU_INCS)
AC_SUBST(DEVXLIB_FLAGS)
AC_SUBST(DEVXLIB_CUDALIBS)
AC_SUBST(PETSC_FLAGS)
AC_SUBST(LIBROCM_LIBS)
AC_SUBST(LIBROCM_INCS)
AC_SUBST(LIBROCM_PATH)
Expand Down
1 change: 1 addition & 0 deletions config/setup.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ lblas = @BLAS_LIBS@
llapack = @LAPACK_LIBS@
lblaspetsc = @BLAS_PETSC_LIBS@
llapackpetsc= @LAPACK_PETSC_LIBS@
petsc_flgs = @PETSC_FLAGS@
lblacs = @BLACS_LIBS@
lscalapack = @SCALAPACK_LIBS@
lslepc = @SLEPC_LIBS@
Expand Down
35 changes: 22 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.23884 h.24d60eb8ca.
# Generated by GNU Autoconf 2.71 for Yambo 5.2.0 r.23950 h.679093ec7f.
#
# 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.23884 h.24d60eb8ca'
PACKAGE_STRING='Yambo 5.2.0 r.23884 h.24d60eb8ca'
PACKAGE_VERSION='5.2.0 r.23950 h.679093ec7f'
PACKAGE_STRING='Yambo 5.2.0 r.23950 h.679093ec7f'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -696,6 +696,8 @@ DEVXLIB_check
LIBXC_check
YPY_check
YDB_check
SLEPC_info
PETSC_info
SLEPC_check
PETSC_check
SLK_check
Expand Down Expand Up @@ -730,6 +732,7 @@ MKLGPU_LIBS
LIBROCM_PATH
LIBROCM_INCS
LIBROCM_LIBS
PETSC_FLAGS
DEVXLIB_CUDALIBS
DEVXLIB_FLAGS
GPU_INCS
Expand Down Expand Up @@ -1659,7 +1662,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.23884 h.24d60eb8ca to adapt to many kinds of systems.
\`configure' configures Yambo 5.2.0 r.23950 h.679093ec7f to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1725,7 +1728,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Yambo 5.2.0 r.23884 h.24d60eb8ca:";;
short | recursive ) echo "Configuration of Yambo 5.2.0 r.23950 h.679093ec7f:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1967,7 +1970,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Yambo configure 5.2.0 r.23884 h.24d60eb8ca
Yambo configure 5.2.0 r.23950 h.679093ec7f
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2596,7 +2599,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.23884 h.24d60eb8ca, which was
It was created by Yambo $as_me 5.2.0 r.23950 h.679093ec7f, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3354,8 +3357,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
SVERSION="5"
SSUBVERSION="2"
SPATCHLEVEL="0"
SREVISION="23884"
SHASH="24d60eb8ca"
SREVISION="23950"
SHASH="679093ec7f"



Expand Down Expand Up @@ -16191,6 +16194,7 @@ if test x"$enable_cuda_fortran" != "xno" ; then
# Flags to be passed to the devicexlib library
#
DEVXLIB_FLAGS="--enable-openmp --enable-cuda-fortran --with-cuda-cc=${with_cuda_cc} --with-cuda-runtime=${with_cuda_runtime}"
PETSC_FLAGS="--with-cuda"
#
case "${FCVERSION}" in
*nvfortran*)
Expand Down Expand Up @@ -16390,6 +16394,7 @@ fi




#

# ============================================================================
Expand Down Expand Up @@ -16716,19 +16721,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 @@ -16822,6 +16829,8 @@ fi





#


Expand Down Expand Up @@ -17780,7 +17789,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.23884 h.24d60eb8ca, which was
This file was extended by Yambo $as_me 5.2.0 r.23950 h.679093ec7f, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -17844,7 +17853,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.23884 h.24d60eb8ca
Yambo config.status 5.2.0 r.23950 h.679093ec7f
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.23884 h.24d60eb8ca, [email protected])
AC_INIT(Yambo, 5.2.0 r.23950 h.679093ec7f, [email protected])
SVERSION="5"
SSUBVERSION="2"
SPATCHLEVEL="0"
SREVISION="23884"
SHASH="24d60eb8ca"
SREVISION="23950"
SHASH="679093ec7f"
AC_SUBST(SVERSION)
AC_SUBST(SSUBVERSION)
AC_SUBST(SPATCHLEVEL)
Expand Down
7 changes: 4 additions & 3 deletions lib/petsc/Makefile.loc
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@ include ../../config/setup
include ../archive/package.list
#
LIBNAME=libpetsc.a
LIBPATH=$(libs_prefix)/$(fc_kind)/${fc}/${yprecision}
LIBPATH=$(libs_prefix)/$(fc_kind)/${fc}/${yprecision} #-${gpu_support}
LIBRARY=$(LIBPATH)/lib/$(LIBNAME)
#
PACKAGE=$(pkgname_petsc)
TARBALL=$(tarball_petsc)
#
include ../config/external_libs_commons.mk
include ../config/external_libs_defs.mk
# FOPTFLAGS="$(fcflags)" COPTFLAGS="$(cflags)" \
#
PETSC_ARCH=yambo_${yprecision}_complex
CONFFLAGS=--prefix="$(LIBPATH)" \
CONFFLAGS=--prefix="$(LIBPATH)" $(petsc_flgs) \
FOPTFLAGS="-O1" COPTFLAGS="-O2" \
--PETSC_ARCH=${PETSC_ARCH} \
--with-ssl=0 \
--with-x=0 \
--with-cxx=0 \
--with-debugging=no \
--with-shared-libraries=$(spetsc) \
--with-blaslapack-lib="$(llapackpetsc) $(lblaspetsc)" \
Expand Down
2 changes: 1 addition & 1 deletion lib/slepc/Makefile.loc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include ../../config/setup
include ../archive/package.list
#
LIBNAME=libslepc.a
LIBPATH=$(libs_prefix)/$(fc_kind)/${fc}/${yprecision}
LIBPATH=$(libs_prefix)/$(fc_kind)/${fc}/${yprecision} #-${gpu_support}
LIBRARY=$(LIBPATH)/lib/$(LIBNAME)
#
PACKAGE=$(pkgname_slepc)
Expand Down
8 changes: 6 additions & 2 deletions src/bse/K_stored_in_a_nest_matrix.F
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,20 @@ subroutine K_stored_in_a_nest_matrix(i_BS_mat,iq,slepc_mat)
call MatCreate(PETSC_COMM_WORLD,R,ierr)
call MatSetSizes(R,PETSC_DECIDE,PETSC_DECIDE,SL_H_dim/2,SL_H_dim/2,ierr)
call MatSetType(R,MATDENSE,ierr)
if (have_cuda) then
#if defined(PETSC_HAVE_CUDA)
if (have_cuda) call MatSetType(R,MATDENSECUDA,ierr)
call MatSetType(R,MATDENSECUDA,ierr)
#else
call warning("Yambo has cuda support. Petsc doesn't. Look for a petsc with gpu support")
#endif
endif
call MatSetFromOptions(R,ierr)
call MatSetUp(R,ierr)
!
call MatCreate(PETSC_COMM_WORLD,C,ierr)
call MatSetSizes(C,PETSC_DECIDE,PETSC_DECIDE,SL_H_dim/2,SL_H_dim/2,ierr)
call MatSetType(C,MATDENSE,ierr)
#ifdef PETSC_HAVE_CUDA
#if defined(PETSC_HAVE_CUDA)
if (have_cuda) call MatSetType(C,MATDENSECUDA,ierr)
#endif
call MatSetFromOptions(C,ierr)
Expand Down
6 changes: 5 additions & 1 deletion src/bse/K_stored_in_a_slepc_matrix.F
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ subroutine K_stored_in_a_slepc_matrix(i_BS_mat,iq,slepc_mat)
call MatSetSizes(slepc_mat,PETSC_DECIDE,PETSC_DECIDE,SL_H_dim,SL_H_dim,ierr)
call MatSetType(slepc_mat, MATDENSE,ierr)

if (have_cuda) then
#if defined(PETSC_HAVE_CUDA)
if (have_cuda) call MatSetType(slepc_mat,MATDENSECUDA,ierr)
call MatSetType(slepc_mat,MATDENSECUDA,ierr)
#else
call warning("Yambo has cuda support. Petsc doesn't. Look for a petsc with gpu support")
#endif
endif

call MatSetUp(slepc_mat,ierr)
!
Expand Down

0 comments on commit 04bbd27

Please sign in to comment.