From 04bbd278d5ade45e3b98706d42169a6dac0fc9a0 Mon Sep 17 00:00:00 2001 From: Davide Sangalli Date: Wed, 11 Dec 2024 23:22:45 +0100 Subject: [PATCH] Version 5.2.0, Revision 23950, Hash 679093ec7f 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 --- config/m4/gpu.m4 | 2 ++ config/setup.in | 1 + configure | 35 +++++++++++++++++----------- include/version/version.m4 | 6 ++--- lib/petsc/Makefile.loc | 7 +++--- lib/slepc/Makefile.loc | 2 +- src/bse/K_stored_in_a_nest_matrix.F | 8 +++++-- src/bse/K_stored_in_a_slepc_matrix.F | 6 ++++- 8 files changed, 44 insertions(+), 23 deletions(-) diff --git a/config/m4/gpu.m4 b/config/m4/gpu.m4 index ccb4c4c85d..42a3d0aedf 100644 --- a/config/m4/gpu.m4 +++ b/config/m4/gpu.m4 @@ -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*) @@ -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) diff --git a/config/setup.in b/config/setup.in index 8ae2e922fa..2b29296c33 100644 --- a/config/setup.in +++ b/config/setup.in @@ -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@ diff --git a/configure b/configure index 0810db7a91..d4958c07b1 100755 --- a/configure +++ b/configure @@ -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 . # @@ -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='yambo@yambo-code.org' PACKAGE_URL='' @@ -696,6 +696,8 @@ DEVXLIB_check LIBXC_check YPY_check YDB_check +SLEPC_info +PETSC_info SLEPC_check PETSC_check SLK_check @@ -730,6 +732,7 @@ MKLGPU_LIBS LIBROCM_PATH LIBROCM_INCS LIBROCM_LIBS +PETSC_FLAGS DEVXLIB_CUDALIBS DEVXLIB_FLAGS GPU_INCS @@ -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]... @@ -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 @@ -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. @@ -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 @@ -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" @@ -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*) @@ -16390,6 +16394,7 @@ fi + # # ============================================================================ @@ -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 @@ -16822,6 +16829,8 @@ fi + + # @@ -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 @@ -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\\" diff --git a/include/version/version.m4 b/include/version/version.m4 index b7be45031f..24c0fddaa5 100644 --- a/include/version/version.m4 +++ b/include/version/version.m4 @@ -1,9 +1,9 @@ -AC_INIT(Yambo, 5.2.0 r.23884 h.24d60eb8ca, yambo@yambo-code.org) +AC_INIT(Yambo, 5.2.0 r.23950 h.679093ec7f, yambo@yambo-code.org) SVERSION="5" SSUBVERSION="2" SPATCHLEVEL="0" -SREVISION="23884" -SHASH="24d60eb8ca" +SREVISION="23950" +SHASH="679093ec7f" AC_SUBST(SVERSION) AC_SUBST(SSUBVERSION) AC_SUBST(SPATCHLEVEL) diff --git a/lib/petsc/Makefile.loc b/lib/petsc/Makefile.loc index 8d92719e2b..6604c44ef2 100644 --- a/lib/petsc/Makefile.loc +++ b/lib/petsc/Makefile.loc @@ -7,7 +7,7 @@ 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) @@ -15,13 +15,14 @@ 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)" \ diff --git a/lib/slepc/Makefile.loc b/lib/slepc/Makefile.loc index bf0ce94985..fd32d8ad8a 100644 --- a/lib/slepc/Makefile.loc +++ b/lib/slepc/Makefile.loc @@ -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) diff --git a/src/bse/K_stored_in_a_nest_matrix.F b/src/bse/K_stored_in_a_nest_matrix.F index ee44533d50..5b7fd1b61f 100644 --- a/src/bse/K_stored_in_a_nest_matrix.F +++ b/src/bse/K_stored_in_a_nest_matrix.F @@ -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) diff --git a/src/bse/K_stored_in_a_slepc_matrix.F b/src/bse/K_stored_in_a_slepc_matrix.F index f33d51ba00..6b3b73d826 100644 --- a/src/bse/K_stored_in_a_slepc_matrix.F +++ b/src/bse/K_stored_in_a_slepc_matrix.F @@ -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) !