From 0b6907a257842c14a79bfd92c9980c8cfc237b8d Mon Sep 17 00:00:00 2001 From: Eric Bylaska Date: Sat, 17 Jun 2023 19:40:47 -0700 Subject: [PATCH 01/11] Fixed velocity input in geom for system crystal option...EJB --- src/geom/geom.F | 6 +++++- src/geom/geom_input.F | 3 +++ src/nwpw/nwpwlib/ion/ion.F | 30 +++++++++++++++--------------- src/symmetry/sym_nwc.F | 11 ++++++++++- src/symmetry/sym_put_geom.F | 7 ++++++- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/geom/geom.F b/src/geom/geom.F index 089c6de750..de2ad8bfc1 100644 --- a/src/geom/geom.F +++ b/src/geom/geom.F @@ -1815,6 +1815,7 @@ logical function geom_cart_set(geom, ncent, t, c, q) end do c end + c C> \brief Extract only the coordinates and charges from a geometry C> instance @@ -2763,8 +2764,11 @@ logical function geom_print(geom) call util_print_centered(LuOut,'Velocities',40,.true.) write(LuOut,3) do icent = 1, ncenter(geom) + do i = 1, 3 + tmp(i) = velocities(i,icent,geom)/scale ! Scale units as necessary + end do write(LuOut,4) icent, tags(icent,geom), charge(icent,geom), - $ (velocities(i,icent,geom),i=1,3) + $ (tmp(i),i=1,3) end do endif c diff --git a/src/geom/geom_input.F b/src/geom/geom_input.F index 6972cf18b9..ba0b81f881 100644 --- a/src/geom/geom_input.F +++ b/src/geom/geom_input.F @@ -677,6 +677,9 @@ subroutine geom_input(rtdb) if (.not. geom_cart_get(geom, ncenter, tags, coords, charge)) $ call errquit('geom_input: geom_cart_get failed', 0, & GEOM_ERR) + if (.not. geom_vel_get(geom, velocities)) + $ call errquit('geom_input: geom_vel_get failed', 0, + & GEOM_ERR) c c If doing user zmatrix then remember values of constant variables diff --git a/src/nwpw/nwpwlib/ion/ion.F b/src/nwpw/nwpwlib/ion/ion.F index c2bd622702..f448546cae 100644 --- a/src/nwpw/nwpwlib/ion/ion.F +++ b/src/nwpw/nwpwlib/ion/ion.F @@ -3,9 +3,9 @@ * * *************************** -* * * -* * ion_end * -* * * +* * * +* * ion_end * +* * * * *************************** subroutine ion_end() implicit none @@ -54,9 +54,9 @@ subroutine ion_end() end * *************************** -* * * -* * ion_write * -* * * +* * * +* * ion_write * +* * * * *************************** subroutine ion_write(rtdb) implicit none @@ -164,9 +164,9 @@ subroutine ion_write(rtdb) end * *************************** -* * * -* * ion_destroy * -* * * +* * * +* * ion_destroy * +* * * * *************************** subroutine ion_destroy() implicit none @@ -187,9 +187,9 @@ subroutine ion_destroy() * *************************** -* * * -* * ion_init * -* * * +* * * +* * ion_init * +* * * * *************************** * * This routine reads in the ion data structure from the @@ -1991,9 +1991,9 @@ double precision function ion_rion2(i,j) * *************************** -* * * -* * ion_vion * -* * * +* * * +* * ion_vion * +* * * * *************************** double precision function ion_vion(i,j) diff --git a/src/symmetry/sym_nwc.F b/src/symmetry/sym_nwc.F index ee1c8e9453..f68cc74590 100644 --- a/src/symmetry/sym_nwc.F +++ b/src/symmetry/sym_nwc.F @@ -78,10 +78,17 @@ subroutine sym_nwc(geom,rtdb,nata,oprint,scale,threquiv,nops) & latags, iatags) LResult = MA_Push_Get(MT_Dbl,nata*(nops+1)*3,'scratch atoms', & lcoord, icoord) .and. lresult + LResult = MA_Push_Get(MT_Dbl,nata*(nops+1)*3,'scratch velocities', + & lvel, ivel) .and. lresult Lresult = MA_Push_Get(MT_Int,nata,'distinct atoms',ldatom,idatom) $ .and. lresult if (.not. lresult) call errquit('sym_nwc: dosymops ma failed', 0, & MA_ERR) + do ii=1,nata + dbl_mb(ivel+3*(ii-1)) = velocities(1,ii,geom) + dbl_mb(ivel+3*(ii-1)+1) = velocities(2,ii,geom) + dbl_mb(ivel+3*(ii-1)+2) = velocities(3,ii,geom) + end do c call dosymops(sym_ops(1,1,geom),nops,coords(1,1,geom), $ tags(1,geom),nata, @@ -89,6 +96,7 @@ subroutine sym_nwc(geom,rtdb,nata,oprint,scale,threquiv,nops) $ cdist,cang,Int_MB(idatom), $ charge(1,geom), charge_new, geom_mass(1,geom), $ mass_new, geom_invnucexp(1,geom),invnucexp_new,threquiv) + c if(nareal.gt.max_cent) then write(6,*)' Too many atoms, increase nw_max_atom in ', @@ -139,7 +147,7 @@ subroutine sym_nwc(geom,rtdb,nata,oprint,scale,threquiv,nops) c Note that the memory for the map (lmscr) is now freed in geom_destroy c call sym_put_in_geom(geom, nata, nareal, - $ Byte_MB(iatags), int_mb(idatom), dbl_mb(icoord), + $ Byte_MB(iatags), int_mb(idatom),dbl_mb(icoord),dbl_mb(ivel), $ lmscr, imscr, nops, charge_new, mass_new, invnucexp_new) c c ... sloppy way for the moment to fix units for 2-d case @@ -221,6 +229,7 @@ subroutine sym_nwc(geom,rtdb,nata,oprint,scale,threquiv,nops) c--> final clean up of memory: gensym and dosymops activities c LResult = MA_Pop_Stack(ldatom) + LResult = MA_Pop_Stack(lvel) LResult = MA_Pop_Stack(lcoord) LResult = MA_Pop_Stack(latags) c diff --git a/src/symmetry/sym_put_geom.F b/src/symmetry/sym_put_geom.F index 30e7dcb9a1..642f41cdd0 100644 --- a/src/symmetry/sym_put_geom.F +++ b/src/symmetry/sym_put_geom.F @@ -1,5 +1,6 @@ subroutine sym_put_in_geom(geom, nat_uniq, nat_new, - $ tags_new, uniq_cent, coords_new, l_map, k_map, nops, + $ tags_new, uniq_cent, coords_new, velocities_new, + $ l_map, k_map, nops, $ charge_new, mass_new, invnucexp_new) C$Id$ implicit none @@ -14,6 +15,7 @@ subroutine sym_put_in_geom(geom, nat_uniq, nat_new, character*16 tags_new(nat_new) integer uniq_cent(nat_uniq) double precision coords_new(3,nat_new) + double precision velocities_new(3,nat_new) double precision charge_new(max_cent) double precision mass_new(max_cent) double precision invnucexp_new(max_cent) @@ -34,6 +36,9 @@ subroutine sym_put_in_geom(geom, nat_uniq, nat_new, enddo call dgemm('n', 'n', 3, nat_new, 3, 1.0d0, amatrix(1,1,geom), 3, $ coords_new, 3, 0.0d0, coords(1,1,geom), 3) + call dgemm('n', 'n', 3, nat_new, 3, 1.0d0, amatrix(1,1,geom), 3, + $ velocities_new, 3, 0.0d0, velocities(1,1,geom), 3) +c c ncenter_unique(geom) = nat_uniq ncenter(geom) = nat_new From a051d0966e6e0a73c04ca91bee11e4f7050e3aba Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 12 Aug 2024 16:51:19 -0700 Subject: [PATCH 02/11] removed debug statement --- src/geom/geom_input.F | 1 - 1 file changed, 1 deletion(-) diff --git a/src/geom/geom_input.F b/src/geom/geom_input.F index ba0b81f881..0c7125ca95 100644 --- a/src/geom/geom_input.F +++ b/src/geom/geom_input.F @@ -7620,7 +7620,6 @@ double complex function geom_powcmpl(c,s,n,big) endif if(abs(c).le.toll.and. . abs(s).le.toll)then - write(6,*) ' zeroes' geom_powcmpl=cmplx(0d0,0d0) else if(n.ne.1) then From aabd25e0d235f6ffaca7580497146d41547f127c Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 4 Oct 2024 16:01:02 -0700 Subject: [PATCH 03/11] unsetting MALLOC_PERTURB for flang-new-20 because of https://github.com/flang-compiler/flang/issues/1456 --- QA/runtests.mpi.unix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/QA/runtests.mpi.unix b/QA/runtests.mpi.unix index cbecbd4759..8d587398ec 100755 --- a/QA/runtests.mpi.unix +++ b/QA/runtests.mpi.unix @@ -32,7 +32,7 @@ export HYDRA_DEBUG=0 # find memory leaks using this glibc feature that # initialized memory blocks to non-zero values -if [[ -z "${USE_ASAN}" ]]; then +if [[ -z "${USE_ASAN}" ]] && [[ "${FC}" != "flang-new-20" ]]; then export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) fi source ./qa_funcs.sh From 9b64a7ec74b267241ec758598edcdddb4e954450 Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 7 Oct 2024 13:54:19 -0700 Subject: [PATCH 04/11] 3 digit accuracy for PSPW because of https://github.com/nwchemgit/nwchem/issues/970 --- QA/nwparse.pl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/QA/nwparse.pl b/QA/nwparse.pl index 20f164caea..5ee3af56ca 100644 --- a/QA/nwparse.pl +++ b/QA/nwparse.pl @@ -312,7 +312,7 @@ } if (! $sgroup) { if (/Total/ && /energy/) { - if (/SCF/ || /DFT/ || /CCSD/ || /MP2/ || /MCSCF/ || /RIMP2/ || /RISCF/ || /BAND/ || /PAW/ || /PSPW/ || /WFN1/ || /xTB/ ) { + if (/SCF/ || /DFT/ || /CCSD/ || /MP2/ || /MCSCF/ || /RIMP2/ || /RISCF/ || /BAND/ || /PAW/ || /WFN1/ || /xTB/ ) { if ($debug) {print "\ndebug: $_";} @line_tokens = split(' '); $num_line_tokens = @line_tokens; @@ -335,6 +335,30 @@ } } if (! $sgroup) { + if (/Total/ && /energy/) { + if ( /PSPW/ ) { + if ($debug) {print "\ndebug: $_";} + @line_tokens = split(' '); + $num_line_tokens = @line_tokens; + if ($debug) { + print "debug:line_tokens: @line_tokens \n"; + print "debug:number : $num_line_tokens \n"; + } + for($itok = 0;$itok < ($num_line_tokens-1); $itok++){ + if (! $quiet) { + printf "%s ", @line_tokens[$itok]; + } + printf FILE_OUTPUT "%s ", @line_tokens[$itok]; + } +# *** Assumes $itok was incremented above + if (! $quiet) { + printf "%.5f\n", set_to_digits(@line_tokens[$itok],4); + } + printf FILE_OUTPUT "%.5f\n", set_to_digits(@line_tokens[$itok],4); + } + } + } + if (! $sgroup) { if (/total/ && /energy/) { if ( /MBPT/ || /LCCD/ || /CCD/ || /LCCSD/ || /CCSD/ || /CCSDT/ || /CCSDTQ/ || /QCISD/ || /CISD/ || /CISDT/ || /CISDTQ/ ) { if ($debug) {print "\ndebug: $_";} From 540200033e0ea5617467c7e79054f85a36f41051 Mon Sep 17 00:00:00 2001 From: edoapra Date: Tue, 3 Sep 2024 18:26:48 -0700 Subject: [PATCH 05/11] gcc-14 test for macos-latest --- .github/workflows/github_actions.yml | 18 ++++++++++++++++++ travis/build_env.sh | 9 +++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 6d631f1741..91eaa3c512 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -395,6 +395,15 @@ jobs: cc: gcc blas: "brew_openblas" blas_size: 4 + - os: macos-latest + experimental: true + mpi_impl: openmpi + armci_network: MPI-TS + nwchem_modules: "nwdft driver solvation" + fc: gfortran + cc: gcc + blas: "brew_openblas" + blas_size: 4 - os: macos-14 experimental: true mpi_impl: openmpi @@ -405,6 +414,15 @@ jobs: blas: "brew_openblas" blas_size: 4 xcode_version: 15.0.1 + - os: macos-latest + experimental: true + mpi_impl: build_mpich + armci_network: MPI-TS + nwchem_modules: "nwdft driver solvation" + fc: gfortran-14 + cc: gcc-14 + blas: "brew_openblas" + blas_size: 4 fail-fast: false env: MPI_IMPL: ${{ matrix.mpi_impl }} diff --git a/travis/build_env.sh b/travis/build_env.sh index eee5a5da44..8376e5508d 100755 --- a/travis/build_env.sh +++ b/travis/build_env.sh @@ -43,8 +43,13 @@ fi $MYSUDO xcode-select -s /Applications/Xcode_"$XCODE_VERSION".app/Contents/Developer fi # HOMEBREW_NO_AUTO_UPDATE=1 brew cask uninstall oclint || true -# HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install gcc "$MPI_IMPL" openblas python3 ||true - HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall gcc "$MPI_IMPL" gsed grep automake autoconf ||true + # HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install gcc "$MPI_IMPL" openblas python3 ||true + if [[ "$MPI_IMPL" == "build_mpich" ]]; then + MPI_FORMULA=" " + else + MPI_FORMULA="$MPI_IMPL" + fi + HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall gcc $MPI_FORMULA gsed grep automake autoconf ||true if [[ "$FC" != "gfortran" ]] && [[ "$FC" == "gfortran*" ]]; then #install non default gfortran, ie gfortran-9 #get version From 6e1c9ff18cf69f282dd93c0fab9557a3474680d0 Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 4 Oct 2024 15:34:04 -0700 Subject: [PATCH 06/11] macos-12 fixes --- .github/workflows/github_actions.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 91eaa3c512..d247396b69 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -257,7 +257,7 @@ jobs: cc: gcc use_libxc: 1 xcode_version: 15.3 - - os: macos-14 + - os: macos-15 experimental: true mpi_impl: openmpi armci_network: MPI-TS @@ -297,7 +297,7 @@ jobs: fc: gfortran-10 cc: gcc-10 use_libxc: 1 - - os: macos-14 + - os: macos-15 experimental: true mpi_impl: openmpi armci_network: MPI-PR @@ -328,7 +328,7 @@ jobs: fc: gfortran-13 blas: "accelerate" blas_size: 4 - - os: macos-12 + - os: macos-13 experimental: true mpi_impl: mpich armci_network: MPI-PT @@ -404,7 +404,7 @@ jobs: cc: gcc blas: "brew_openblas" blas_size: 4 - - os: macos-14 + - os: macos-15 experimental: true mpi_impl: openmpi armci_network: MPI-TS From d6902481f21c5645f58c9e47eea368cebc533165 Mon Sep 17 00:00:00 2001 From: edoapra Date: Fri, 4 Oct 2024 17:45:18 -0700 Subject: [PATCH 07/11] fetch external tarballs --- .github/workflows/github_actions.yml | 5 +++++ travis/cache_fetch.sh | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index d247396b69..4a884d7715 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -495,6 +495,11 @@ jobs: if: steps.setup-cache.outputs.cache-hit == 'true' run: | ./travis/cache_fetch.sh + - name: get external files + if: steps.setup-cache.outputs.cache-hit != 'true' + run: | + mkdir -p ~/cache + NWCHEM_TOP=$(pwd) ./contrib/getfiles.nwchem ~/cache - name: compile id: compile run: | diff --git a/travis/cache_fetch.sh b/travis/cache_fetch.sh index f0a9b1932f..178b2707c2 100755 --- a/travis/cache_fetch.sh +++ b/travis/cache_fetch.sh @@ -12,3 +12,6 @@ set -v ls -lart /home/runner/work/nwchem/nwchem/src/libext/mpich/mpich/../../include || true ls -lart /home/runner/work/nwchem/nwchem/src/libext/include || true ls -lart /home/runner/work/nwchem/nwchem/src/libext/mpich || true + rsync -av ~/cache/dftd3.tgz src/nwpw/nwpwlib/nwpwxc/. || true + rsync -av ~/cache/OpenBLAS*gz src/libext/openblas/. || true + rsync -av ~/cache/scalapack*zip src/libext/scalapack/. || true From 0a2f4ecd1ace0f189d93737bdc21347c20fe0f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edoardo=20Apr=C3=A0?= Date: Mon, 7 Oct 2024 22:16:03 -0700 Subject: [PATCH 08/11] MPI-TS for MacOS --- .github/workflows/github_actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 4a884d7715..6dfeae07ca 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -331,7 +331,7 @@ jobs: - os: macos-13 experimental: true mpi_impl: mpich - armci_network: MPI-PT + armci_network: MPI-TS nwchem_modules: "nwdft solvation driver" fc: ifort xcode_version: 15.4 From 83349be7c2f5e0e84c60d4879b40393ae9937aa2 Mon Sep 17 00:00:00 2001 From: edoapra Date: Tue, 8 Oct 2024 14:11:55 -0700 Subject: [PATCH 09/11] use ifort & gcc-11 --- .github/workflows/github_actions.yml | 1 + travis/nwchem.bashrc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 6dfeae07ca..2b91861d1f 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -334,6 +334,7 @@ jobs: armci_network: MPI-TS nwchem_modules: "nwdft solvation driver" fc: ifort + cc: gcc-11 xcode_version: 15.4 - os: ubuntu-20.04 experimental: true diff --git a/travis/nwchem.bashrc b/travis/nwchem.bashrc index 335d240b9f..a5f2e3c410 100644 --- a/travis/nwchem.bashrc +++ b/travis/nwchem.bashrc @@ -65,8 +65,8 @@ if [[ "$FC" == "ifort" ]] || [[ "$FC" == "ifx" ]] ; then #force icc on macos to cross-compile x86 on arm64 # icx not available on macos if [[ "$os" == "Darwin" ]]; then - CC=icc - CXX=icc +# CC=icc +# CXX=icc # Intel MPI not available on macos # export BUILD_MPICH=1 unset BUILD_PLUMED From 3a3630993cdc7fdb0ed316e379eea331c6f9c4d5 Mon Sep 17 00:00:00 2001 From: edoapra Date: Tue, 8 Oct 2024 17:10:46 -0700 Subject: [PATCH 10/11] removed ifort MacOS step --- .github/workflows/github_actions.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 2b91861d1f..3f5b819f13 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -328,14 +328,6 @@ jobs: fc: gfortran-13 blas: "accelerate" blas_size: 4 - - os: macos-13 - experimental: true - mpi_impl: mpich - armci_network: MPI-TS - nwchem_modules: "nwdft solvation driver" - fc: ifort - cc: gcc-11 - xcode_version: 15.4 - os: ubuntu-20.04 experimental: true mpi_impl: mpich From 063f49d7b2129884d365d56eaab5771c28fd9ca2 Mon Sep 17 00:00:00 2001 From: edoapra Date: Mon, 12 Aug 2024 09:56:06 -0700 Subject: [PATCH 11/11] macos: silence brew warnings --- travis/build_env.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/travis/build_env.sh b/travis/build_env.sh index 8376e5508d..3bf740577a 100755 --- a/travis/build_env.sh +++ b/travis/build_env.sh @@ -113,7 +113,8 @@ fi brew update || true brew list open-mpi >& /dev/null ; myexit=$? if [[ $myexit == 0 ]]; then brew unlink open-mpi || true ; fi - brew reinstall mpich && brew upgrade mpich && brew link --overwrite mpich || true + brew reinstall --quiet mpich && brew unlink mpich && brew link mpich || true +## brew reinstall --quiet mpich || true fi if [[ "$BLAS_ENV" == "brew_openblas" ]]; then brew install openblas @@ -123,7 +124,7 @@ fi PKG_CONFIG_PATH=$HOMEBREW_PREFIX/opt/openblas/lib/pkgconfig pkg-config --libs openblas fi # if [[ "$MPI_IMPL" == "openmpi" ]]; then -# HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install scalapack +# HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_AUTO_UPDATE=1 brew install --quiet scalapack # fi fi if [[ "$os" == "Linux" ]]; then