From ce6b298c96fef6f056cbe02a27feccae74f4b5be Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 12:33:22 -0700 Subject: [PATCH 1/9] removed extra arg not used in actual called routine --- src/nwdft/grid/grid_quadv0.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nwdft/grid/grid_quadv0.F b/src/nwdft/grid/grid_quadv0.F index 6632e960c1..cec77880e5 100644 --- a/src/nwdft/grid/grid_quadv0.F +++ b/src/nwdft/grid/grid_quadv0.F @@ -464,7 +464,7 @@ c DM in last position is the scf DM enddo elseif (adft) then call adft_reduce(nbf_xc, nctrs, int_mb(icetobfr), tmat, ipol, - & dbl_mb(irdens_atom), nbf_xc_mxnbf_ce) + & dbl_mb(irdens_atom)) else call util_ga_mat_reduce(nbf_ao, nctrs, int_mb(icetobfr), g_dens, & ipol, dbl_mb(irdens_atom), 'absmax', From 9e79d78b5651678e0ab1c3780d7420503bfa291b Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 12:34:26 -0700 Subject: [PATCH 2/9] adft_reduce moved to dft_utilmap --- src/nwdft/grid/grid_quadv0.F | 22 ---------------------- src/nwdft/util/dft_utilmap.F | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/nwdft/grid/grid_quadv0.F b/src/nwdft/grid/grid_quadv0.F index cec77880e5..bb9700f93e 100644 --- a/src/nwdft/grid/grid_quadv0.F +++ b/src/nwdft/grid/grid_quadv0.F @@ -1044,25 +1044,3 @@ c return end - subroutine adft_reduce(nbf, nat, cetobfr, coef, ipol, rdens_atom) - implicit none - integer nbf, nat, ipol, mxnbf - integer cetobfr(2,nat) - double precision rdens_atom(nat,nat,ipol),coef(nbf,ipol) - double precision dabsmax - external dabsmax - - integer iat,istart,iend - - rdens_atom(:,:,:) = 0d0 - - do iat=1,nat - istart = cetobfr(1,iat) - iend = cetobfr(2,iat) - rdens_atom(1,iat,1) = dabsmax(iend-istart+1,coef(istart,1)) - if (ipol.gt.1) then - rdens_atom(1,iat,2) = dabsmax(iend-istart+1,coef(istart,2)) - endif - enddo - - end diff --git a/src/nwdft/util/dft_utilmap.F b/src/nwdft/util/dft_utilmap.F index d17d9d01c2..d45fc17ef8 100644 --- a/src/nwdft/util/dft_utilmap.F +++ b/src/nwdft/util/dft_utilmap.F @@ -327,5 +327,27 @@ c enddo return end + subroutine adft_reduce(nbf, nat, cetobfr, coef, ipol, rdens_atom) + implicit none + integer nbf, nat, ipol, mxnbf + integer cetobfr(2,nat) + double precision rdens_atom(nat,nat,ipol),coef(nbf,ipol) + double precision dabsmax + external dabsmax + + integer iat,istart,iend + + rdens_atom(:,:,:) = 0d0 + + do iat=1,nat + istart = cetobfr(1,iat) + iend = cetobfr(2,iat) + rdens_atom(1,iat,1) = dabsmax(iend-istart+1,coef(istart,1)) + if (ipol.gt.1) then + rdens_atom(1,iat,2) = dabsmax(iend-istart+1,coef(istart,2)) + endif + enddo + + end C> C> @} From 0db2d807aaffab7b8fcca0a4bb289671d7647375 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 19:06:58 -0700 Subject: [PATCH 3/9] incomplete fixes for crayftn --- src/libext/openblas/build_openblas.sh | 36 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/src/libext/openblas/build_openblas.sh b/src/libext/openblas/build_openblas.sh index dc92319a8f..66c374d4e7 100755 --- a/src/libext/openblas/build_openblas.sh +++ b/src/libext/openblas/build_openblas.sh @@ -111,20 +111,21 @@ if [[ ${FC} == ftn ]]; then # echo ' ' # echo 'openblas installation not ready for crayftn ' # echo ' ' - if ! [ -x "$(command -v gfortran)" ]; then - echo " please load the gcc module (not prgenv)" - echo " by executing" - echo " module load gcc " - echo " " - exit 1 - fi - FC=gfortran - CCORG=${CC} - CC=clang - export PATH=/opt/cray/pe/cce/default/cce-clang/x86_64/bin:$PATH - FORCETARGET+=' FC=gfortran CC=clang ' +# if ! [ -x "$(command -v gfortran)" ]; then +# echo " please load the gcc module (not prgenv)" +# echo " by executing" +# echo " module load gcc " +# echo " " +# exit 1 +# fi +# FC=gfortran +# CCORG=${CC} +# CC=clang +# export PATH=/opt/cray/pe/cce/default/cce-clang/x86_64/bin:$PATH +# FORCETARGET+=' FC=gfortran CC=clang ' # exit 1 -# exit 1 + # exit 1 + _FC=crayftn fi fi if [[ -n ${FC} ]] && [[ ${FC} == xlf ]] || [[ ${FC} == xlf_r ]] || [[ ${FC} == xlf90 ]]|| [[ ${FC} == xlf90_r ]]; then @@ -134,6 +135,9 @@ if [[ -n ${FC} ]] && [[ ${FC} == xlf ]] || [[ ${FC} == xlf_r ]] || [[ ${FC} == elif [[ -n ${FC} ]] && [[ "${FC}" == "flang" ]] || [[ "${FC}" == "amdflang" ]]; then FORCETARGET+=' F_COMPILER=FLANG ' LAPACK_FPFLAGS_VAL=" -O1 -g -Kieee" +elif [[ "${_FC}" == "crayftn" ]] ; then +# FORCETARGET+=' F_COMPILER=FLANG ' + LAPACK_FPFLAGS_VAL=" -s integer64" elif [[ -n ${FC} ]] && [[ "${FC}" == "pgf90" ]] || [[ "${FC}" == "nvfortran" ]]; then FORCETARGET+=' F_COMPILER=PGI ' if [[ "${FC}" == "nvfortran" ]]; then @@ -222,7 +226,7 @@ if [[ ! -z "${USE_OPENMP}" ]]; then fi GOTFREEBSD=$(uname -o 2>&1|awk ' /FreeBSD/ {print "1";exit}') MYMAKE=make -MAKEJ=" -j4" +MAKEJ=" -j3 " if [[ "${GOTFREEBSD}" == 1 ]]; then MAKEJ=" " MYMAKE=gmake @@ -240,7 +244,9 @@ else $MYMAKE FC=$FC CC=$CC HOSTCC=gcc $FORCETARGET LAPACK_FPFLAGS="$LAPACK_FPFLAGS_VAL" INTERFACE64="$sixty4_int" BINARY="$binary" NUM_THREADS=128 NO_CBLAS=1 NO_LAPACKE=1 DEBUG=0 USE_THREAD="$THREADOPT" libs netlib $MAKEJ >& openblas.log fi if [[ "$?" != "0" ]]; then - tail -500 openblas.log + echo error code '$?' + ls -l openblas.log + tail -n 500 openblas.log echo " " echo "OpenBLAS compilation failed" echo " " From 49927e4fa58609e909bb47d861cf2806aff88e10 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 19:07:26 -0700 Subject: [PATCH 4/9] updates for Cray compilers --- src/config/makefile.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config/makefile.h b/src/config/makefile.h index b27d3812c5..cd358454cd 100644 --- a/src/config/makefile.h +++ b/src/config/makefile.h @@ -2145,6 +2145,7 @@ ifneq ($(TARGET),LINUX) GOTCLANG= $(shell $(_CC) -dM -E - /dev/null |grep __clang__|head -1|cut -c19) ifeq ($(GOTCLANG),1) COPTIONS += -fPIC + COPTIONS += -Wno-deprecated-non-prototype endif GOTFREEBSD= $(shell uname -o 2>&1|awk ' /FreeBSD/ {print "1";exit}') @@ -2772,7 +2773,9 @@ ifneq ($(TARGET),LINUX) ifeq ($(_FC),crayftn) # Jeff: Cray Fortran supports preprocessing as of version 8.2.2 (at least) # EXPLICITF = FALSE - FOPTIONS += -hsystem_alloc -hoverindex + FOPTIONS += -hoverindex + FOPTIONS += -dC + LDOPTIONS += -hsystem_alloc # workaround for vectorization failures with cce 11 FOPTIONS += -hfp1 ifdef BUILD_OPENBLAS From 19e4c0be291dbbdcc50a75e1058bbecd0f97e182 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 19:08:31 -0700 Subject: [PATCH 5/9] increase number of integers for memory output https://github.com/nwchemgit/nwchem/issues/838 --- src/nwchem.F | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nwchem.F b/src/nwchem.F index 6512a199d6..20b2ae6740 100644 --- a/src/nwchem.F +++ b/src/nwchem.F @@ -665,11 +665,11 @@ c & cstatus, & fstatus 3 format(/ - $ ' heap = ', i10,' doubles',' = ',f8.1,' Mbytes',/, - $ ' stack = ', i10,' doubles',' = ',f8.1,' Mbytes',/, - $ ' global = ', i10,' doubles',' = ',f8.1,' Mbytes', + $ ' heap = ', i12,' doubles',' = ',f10.1,' Mbytes',/, + $ ' stack = ', i12,' doubles',' = ',f10.1,' Mbytes',/, + $ ' global = ', i12,' doubles',' = ',f10.1,' Mbytes', & ' ',A,/, - $ ' total = ', i10,' doubles',' = ',f8.1,' Mbytes',/, + $ ' total = ', i12,' doubles',' = ',f10.1,' Mbytes',/, $ ' verify = ', a3,/, $ ' hardfail = ', a3,//) c From 1f6803fe050ae999024a3e3bcc1715a863741350 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 19:32:55 -0700 Subject: [PATCH 6/9] crayftn -ef option to create .mod --- src/libext/openblas/build_openblas.sh | 3 ++- src/libext/openblas/crayftn.patch | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/libext/openblas/crayftn.patch diff --git a/src/libext/openblas/build_openblas.sh b/src/libext/openblas/build_openblas.sh index 66c374d4e7..174a541534 100755 --- a/src/libext/openblas/build_openblas.sh +++ b/src/libext/openblas/build_openblas.sh @@ -27,6 +27,7 @@ patch -p0 -s -N < ../makesys.patch # patch for pgi/nvfortran missing -march=armv8 patch -p0 -s -N < ../arm64_fopt.patch patch -p1 -s -N < ../9402df5604e69f86f58953e3883f33f98c930baf.patch +patch -p0 -s -N < ../crayftn.patch if [[ -z "${FORCETARGET}" ]]; then FORCETARGET=" " UNAME_S=$(uname -s) @@ -137,7 +138,7 @@ elif [[ -n ${FC} ]] && [[ "${FC}" == "flang" ]] || [[ "${FC}" == "amdflang" ]]; LAPACK_FPFLAGS_VAL=" -O1 -g -Kieee" elif [[ "${_FC}" == "crayftn" ]] ; then # FORCETARGET+=' F_COMPILER=FLANG ' - LAPACK_FPFLAGS_VAL=" -s integer64" + LAPACK_FPFLAGS_VAL=" -s integer64 -ef " elif [[ -n ${FC} ]] && [[ "${FC}" == "pgf90" ]] || [[ "${FC}" == "nvfortran" ]]; then FORCETARGET+=' F_COMPILER=PGI ' if [[ "${FC}" == "nvfortran" ]]; then diff --git a/src/libext/openblas/crayftn.patch b/src/libext/openblas/crayftn.patch new file mode 100644 index 0000000000..9422ed7df7 --- /dev/null +++ b/src/libext/openblas/crayftn.patch @@ -0,0 +1,10 @@ +--- Makefile.system.org 2023-07-26 19:26:30.000000000 -0700 ++++ Makefile.system 2023-07-26 19:26:54.000000000 -0700 +@@ -1323,6 +1323,7 @@ + ifeq ($(F_COMPILER), CRAY) + CCOMMON_OPT += -DF_INTERFACE_INTEL + FCOMMON_OPT += -hnopattern ++FCOMMON_OPT += -ef + ifdef INTERFACE64 + ifneq ($(INTERFACE64), 0) + FCOMMON_OPT += -s integer64 From 09de6ffc28e41f42414d66f06347ad52005d96ad Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 22:26:47 -0700 Subject: [PATCH 7/9] wrong defintion --- src/mp2_grad/mp2_make_dip_mom.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mp2_grad/mp2_make_dip_mom.F b/src/mp2_grad/mp2_make_dip_mom.F index 687553b3f0..fcc96e9298 100644 --- a/src/mp2_grad/mp2_make_dip_mom.F +++ b/src/mp2_grad/mp2_make_dip_mom.F @@ -22,7 +22,7 @@ c double precision mp2y, scfy double precision mp2z, scfz double precision ndip(3) - logical ga_create_atom_blocked + integer ga_create_atom_blocked external ga_create_atom_blocked integer geom c From f287af4b1577bbff61bf06a3347b13b30d49bf17 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 22:27:11 -0700 Subject: [PATCH 8/9] cray update --- src/config/makefile.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/makefile.h b/src/config/makefile.h index cd358454cd..191ea8ebbd 100644 --- a/src/config/makefile.h +++ b/src/config/makefile.h @@ -2774,7 +2774,8 @@ ifneq ($(TARGET),LINUX) # Jeff: Cray Fortran supports preprocessing as of version 8.2.2 (at least) # EXPLICITF = FALSE FOPTIONS += -hoverindex - FOPTIONS += -dC + FOPTIONS += -dC # fix rt-tddft hacking for derived types + FOPTIONS += -ef # create f90 .mod LDOPTIONS += -hsystem_alloc # workaround for vectorization failures with cce 11 FOPTIONS += -hfp1 From 63d638525dd39dbbc574b964da64aba798af43b2 Mon Sep 17 00:00:00 2001 From: edoapra Date: Wed, 26 Jul 2023 22:27:44 -0700 Subject: [PATCH 9/9] fix for crayftn --- src/libext/openblas/build_openblas.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libext/openblas/build_openblas.sh b/src/libext/openblas/build_openblas.sh index 174a541534..c8fcb3faaf 100755 --- a/src/libext/openblas/build_openblas.sh +++ b/src/libext/openblas/build_openblas.sh @@ -255,6 +255,9 @@ if [[ "$?" != "0" ]]; then fi mkdir -p ../../lib +if [[ "${_FC}" == "crayftn" ]] ; then + cd lapack-netlib/SRC; ar rUv ../../libopenblas*-*.a la_constants.o ;cd ../.. +fi if [[ $(uname -s) == "Linux" ]]; then if [ -x "$(command -v xx-info)" ]; then MYSTRIP=$(xx-info)-strip