From 27657f873928b80698a2fbf11234dab15b589e0c Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 23 Jun 2023 12:34:07 -0700 Subject: [PATCH 1/6] fix macos installation --- src/libext/libext_utils/cmake.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libext/libext_utils/cmake.sh b/src/libext/libext_utils/cmake.sh index 9909db4eb9..451fd11f60 100644 --- a/src/libext/libext_utils/cmake.sh +++ b/src/libext/libext_utils/cmake.sh @@ -29,7 +29,11 @@ get_cmake_release(){ else curl -L ${CMAKE_URL} -o cmake-${CMAKE_VER}.tar.gz tar xzf cmake-${CMAKE_VER}.tar.gz - CMAKE=`pwd`/cmake-${CMAKE_VER}-linux-${CMAKE_CPU}/bin/cmake + if [[ ${UNAME_S} == "Darwin" ]] ; then + CMAKE=`pwd`/cmake-${CMAKE_VER}-macos-universal/CMake.app/Contents/bin/cmake + else + CMAKE=`pwd`/cmake-${CMAKE_VER}-linux-${CMAKE_CPU}/bin/cmake + fi fi cd $orgdir From e4ddbd01f272ec77884beb0b3384c9b34393d89b Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 23 Jun 2023 12:34:46 -0700 Subject: [PATCH 2/6] define c++ to fix Intel/easybuild problems --- src/libext/elpa/build_elpa.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libext/elpa/build_elpa.sh b/src/libext/elpa/build_elpa.sh index e879d9d49d..5a0415b977 100755 --- a/src/libext/elpa/build_elpa.sh +++ b/src/libext/elpa/build_elpa.sh @@ -62,6 +62,7 @@ else else MPIF90=mpif90 MPICC=mpicc + MPICXX=mpicxx #fix include path # FCFLAGS+="-I`${NWCHEM_TOP}/src/tools/guess-mpidefs --mpi_include`" # CFLAGS+="-I`${NWCHEM_TOP}/src/tools/guess-mpidefs --mpi_include`" @@ -84,6 +85,9 @@ fi if [[ -z "${CC}" ]]; then CC=cc fi +if [[ -z "${CXX}" ]]; then + CXX=c++ +fi if [[ ${FC} == flang ]] || [[ ${PE_ENV} == AOCC ]]; then GOTCLANG=1 else @@ -140,6 +144,9 @@ if [[ -z "$MPICH_CC" ]] ; then export MPICH_CC="$CC" fi echo MPICH_CC is "$MPICH_CC" +if [[ -z "$MPICH_CXX" ]] ; then + export MPICH_CXX="$CXX" +fi #Intel MPI if [[ -z "$I_MPI_F90" ]] ; then export I_MPI_F90="$FC" @@ -147,6 +154,9 @@ fi if [[ -z "$I_MPI_CC" ]] ; then export I_MPI_CC="$CC" fi +if [[ -z "$I_MPI_CXX" ]] ; then + export I_MPI_CXX="$CXX" +fi echo I_MPI_F90 is "$I_MPI_F90" if [[ -z "${FORCETARGET}" ]]; then @@ -232,7 +242,7 @@ export SCALAPACK_FCFLAGS+="${MYLINK}" export LIBS="${MYLINK}" export FC=$MPIF90 export CC=$MPICC - FC=$MPIF90 CC=$MPICC ../configure \ + FC=$MPIF90 CC=$MPICC CXX=$MPICXX ../configure \ $sixty4_int \ CFLAGS="$MYCFLAGS" \ FCFLAGS="$MYFCFLAGS" \ @@ -254,7 +264,7 @@ if [[ "$USE_MANUALCPP" == 1 ]]; then echo @@@@ MANUALCPP @@@ make FC="$SRCDIR/remove_xcompiler $SRCDIR/manual_cpp mpif90" -j5 else - make FC=$MPIF90 CC=$MPICC -j5 + make FC=$MPIF90 CC=$MPICC CXX=$MPICXX -j5 # make V=1 FC=$MPIF90 CC=$MPICC -j5 fi From 77aad584734c70033f56fda9aae9103cbeec50b1 Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 23 Jun 2023 18:10:40 -0700 Subject: [PATCH 3/6] pass only stdout to nwparse --- QA/runtests.mpi.unix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/QA/runtests.mpi.unix b/QA/runtests.mpi.unix index 812f9f9e03..9304cf59a6 100755 --- a/QA/runtests.mpi.unix +++ b/QA/runtests.mpi.unix @@ -225,6 +225,7 @@ do echo " copying input and verified output files" OUTPUTFILE=${STUB}.out + ERRORFILE=${STUB}.err INPUTFILE=${STUB}.nw # @@ -354,7 +355,7 @@ sync if [ $NPROC -gt 0 ]; then if [ $NONSTD_MPI -ne 0 ]; then if [ -z $USE_SLEEPLOOP ]; then - ${MPIRUN} ${NWCHEM} ${INPUTFILE} >& ${OUTPUTFILE} + ${MPIRUN} ${NWCHEM} ${INPUTFILE} 2> ${ERRORFILE} 1> ${OUTPUTFILE} else ${NWCHEM_TOP}/QA/sleep_loopqa.sh $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE $OUTPUTFILE fi @@ -465,6 +466,7 @@ sync fi diff -w ${STUB}.ok.out.nwparse ${STUB}.out.nwparse >& /dev/null + cat ${ERRORFILE} diff1status=$? # fi From e055443a3320ae179de2f2db83f63be095d5701d Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 23 Jun 2023 19:02:33 -0700 Subject: [PATCH 4/6] redirect stderr --- QA/runtests.mpi.unix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/QA/runtests.mpi.unix b/QA/runtests.mpi.unix index 9304cf59a6..a64829c6c6 100755 --- a/QA/runtests.mpi.unix +++ b/QA/runtests.mpi.unix @@ -357,15 +357,15 @@ sync if [ -z $USE_SLEEPLOOP ]; then ${MPIRUN} ${NWCHEM} ${INPUTFILE} 2> ${ERRORFILE} 1> ${OUTPUTFILE} else - ${NWCHEM_TOP}/QA/sleep_loopqa.sh $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE $OUTPUTFILE + ${NWCHEM_TOP}/QA/sleep_loopqa.sh $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE 2> $ERRORFILE 1> $OUTPUTFILE fi runstatus=$? else - $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE >& $OUTPUTFILE + $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE 2> $ERRORFILE 1> $OUTPUTFILE runstatus=$? fi else - $NWCHEM $INPUTFILE >& $OUTPUTFILE + $NWCHEM $INPUTFILE 2> $ERRORFILE 1> $OUTPUTFILE runstatus=$? fi [ -f $OUTPUTFILE ] && cp $OUTPUTFILE $TESTOUTPUTS/$OUTPUTFILE From be3b2b07edc139a9af5a9dbad18d2be5bb59c652 Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 23 Jun 2023 19:34:08 -0700 Subject: [PATCH 5/6] used stderr everywhere --- QA/runtests.mpi.unix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/QA/runtests.mpi.unix b/QA/runtests.mpi.unix index a64829c6c6..7965b29f3b 100755 --- a/QA/runtests.mpi.unix +++ b/QA/runtests.mpi.unix @@ -394,19 +394,19 @@ sync # know what we are doing (i.e. above this script) and simply use that # verbatim. Set MPIRUN_PATH for this purpose, its value is transfered # to MPIRUN at some point in this script. - $MPIRUN $NWCHEM $INPUTFILE >& $TESTOUTPUTS/$OUTPUTFILE + $MPIRUN $NWCHEM $INPUTFILE 2> $TESTOUTPUTS/$ERRORFILE 1> $TESTOUTPUTS/$OUTPUTFILE runstatus=$? else # In the case of standard MPI we construct the appropriate command here. if [ -z $USE_SLEEPLOOP ]; then - $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE >& ${TESTOUTPUTS}/${OUTPUTFILE} + $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE 2> ${TESTOUTPUTS}/${ERRORFILE} 1> ${TESTOUTPUTS}/${OUTPUTFILE} else - ${NWCHEM_TOP}/QA/sleep_loopqa.sh $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE $OUTPUTFILE + ${NWCHEM_TOP}/QA/sleep_loopqa.sh $MPIRUN $NPOPT $NPROC $NWCHEM $INPUTFILE 2> $ERRORFILE 1> $OUTPUTFILE fi runstatus=$? fi else - $NWCHEM $INPUTFILE >& $TESTOUTPUTS/$OUTPUTFILE + $NWCHEM $INPUTFILE 2> $TESTOUTPUTS/$ERRORFILE 1> $TESTOUTPUTS/$OUTPUTFILE runstatus=$? fi # From df119cd95e7983a77ed0e1cf85b233ae6119f709 Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 23 Jun 2023 19:35:09 -0700 Subject: [PATCH 6/6] detect duplicate presence of the same function https://github.com/nwchemgit/nwchem/issues/799 --- src/ddscf/int_1e_ga.F | 48 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/ddscf/int_1e_ga.F b/src/ddscf/int_1e_ga.F index d67992c0c5..e7c348ff64 100644 --- a/src/ddscf/int_1e_ga.F +++ b/src/ddscf/int_1e_ga.F @@ -48,6 +48,7 @@ subroutine int_1e_ga(ibas, jbas, g, integ_type, oskel) #include "cscfps.fh" #include "sym.fh" #include "geom.fh" +#include "util.fh" c c Compute the desired type of integrals (kinetic, potential, overlap) c and ADD them into the given global array. @@ -68,13 +69,16 @@ subroutine int_1e_ga(ibas, jbas, g, integ_type, oskel) c local variables c integer type - logical dobq + integer bad_ovl,adrs,lds,i0,i1,j0,j1 + logical dobq,oprint_s,oprint_check_s character*255 integ_type1 c call ga_sync() c dobq = geom_extbq_on() integ_type1 = integ_type + oprint_check_s = util_print('check_s',print_high) + oprint_s = util_print('ao overlap',print_debug) c if (inp_compare(.false., integ_type1, 'potential0')) then integ_type1='potential' @@ -157,6 +161,23 @@ subroutine int_1e_ga(ibas, jbas, g, integ_type, oskel) call int_1e_oldga(ibas, jbas, g, integ_type1, oskel) end if c +c overlap: check if offdiagonal elements are 1 -> same basis + if(type.eq.3.and.oprint_s) call ga_print(g) + if(type.eq.3.and.oprint_check_s) then + bad_ovl=0 + call ga_distribution(g, + . ga_nodeid(), i0, i1, j0, j1) + if (i0.gt.0 .and. i0.le.i1) then + call ga_access(g, i0, i1, j0, j1, adrs, lds) + call int_checks(i0, i1, j0, j1,dbl_mb(adrs), + A bad_ovl) + endif + call ga_igop(2023,bad_ovl,1, '+') + if(bad_ovl.gt.0) then + call errquit('int_1e_ga: same basis from S matrix', + A bad_ovl, BASIS_ERR) + endif + endif end c subroutine int_1e_ooldga(ibas, jbas, g, integ_type, oskel) @@ -715,3 +736,28 @@ subroutine int_1e_oldga0(ibas, g, type, oskel, if (oscfps) call pstat_off(ps_int_1e) c end + subroutine int_checks(i0, i1, j0, j1, s, sing_vals) + implicit none +#include "stdio.fh" + integer i0, i1, j0, j1 + double precision s(i0:i1,j0:j1) + integer sing_vals +c + integer i,j + double precision eps + parameter(eps=1d-8) +c + if(i0.lt.j0) return + do j=j0,j1 + do i=i0,min(i1,j1) + if(i.gt.j) then + if (abs(s(i,j)-1d0).lt.eps) then + write(luout,1) i,j + sing_vals=sing_vals+1 + endif + endif + enddo + enddo + 1 format(' basis ',i5,' and ',i5,' are the same') + return + end