Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: NWChem with patch and prerequisite GlobalArrays for Flexiblas. #85

Open
wants to merge 2 commits into
base: computecanada-main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
easyblock = 'ConfigureMake'

name = 'GlobalArrays'
version = '5.8.2'

homepage = 'https://hpc.pnl.gov/globalarrays'
description = "Global Arrays (GA) is a Partitioned Global Address Space (PGAS) programming model"

toolchain = {'name': 'iofbf', 'version': '2023a'}
toolchainopts = {'usempi': True}

source_urls = ['https://github.com/%(name)s/ga/releases/download/']
sources = ['v%(version)s/ga-%(version)s.tar.gz']
checksums = ['51599e4abfe36f05cecfaffa33be19efbe9e9fa42d035fd3f866469b663c22a2']

configopts = ' --with-mpi --enable-i8'
configopts += ' --with-blas8="-lflexiblas64_intel"'
configopts += ' --with-scalapack="-lscalapack64"'

# select armci network as (Comex) MPI-1 two-sided
configopts += ' --with-mpi-ts'

sanity_check_paths = {
'files': ['bin/adjust.x', 'bin/collisions.x', 'bin/ga-config', 'lib/libarmci.a',
'lib/libcomex.a', 'lib/libga.a'],
'dirs': ['include'],
}

moduleclass = 'lib'
25 changes: 25 additions & 0 deletions easybuild/easyconfigs/n/NWChem/NWChem-7.0.2_fix_gnumakefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Author: @maxim-masterov (SURF)
# Fixes quotes in the makefile to ensure correct variable substitution in the source code.
diff -Nru nwchem-7.0.2.orig/src/GNUmakefile nwchem-7.0.2/src/GNUmakefile
--- nwchem-7.0.2.orig/src/GNUmakefile 2021-08-30 13:39:57.168736415 +0200
+++ nwchem-7.0.2/src/GNUmakefile 2021-09-01 12:41:02.105915193 +0200
@@ -5,13 +5,13 @@

SUBDIRS = $(NWSUBDIRS)

- LIB_DEFINES = -DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" \
- -DCOMPILATION_DIR="'$(TOPDIR)'" \
- -DNWCHEM_BRANCH="'$(CODE_BRANCH)'"
+ LIB_DEFINES = -DCOMPILATION_DATE=\"`date +%a_%b_%d_%H:%M:%S_%Y`\" \
+ -DCOMPILATION_DIR=\"$(TOPDIR)\" \
+ -DNWCHEM_BRANCH=\"$(CODE_BRANCH)\"
ifeq ($(XLFMAC),y)
- FOPTIONS += -WF,-DCOMPILATION_DATE="'`date +%a_%b_%d_%H:%M:%S_%Y`'" \
- -WF,-DCOMPILATION_DIR="'$(TOPDIR)'" \
- -WF,-DNWCHEM_BRANCH="'$(CODE_BRANCH)'"
+ FOPTIONS += -WF,-DCOMPILATION_DATE=\"`date +%a_%b_%d_%H:%M:%S_%Y`\" \
+ -WF,-DCOMPILATION_DIR=\"$(TOPDIR)\" \
+ -WF,-DNWCHEM_BRANCH=\"$(CODE_BRANCH)\"
LIB_DEFINES=
DEFINES=
endif
79 changes: 79 additions & 0 deletions easybuild/easyconfigs/n/NWChem/NWChem-7.2.3-PR-1042.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
diff --git a/src/basis/basis.F b/src/basis/basis.F
index c599014261..4915831234 100644
--- a/src/basis/basis.F
+++ b/src/basis/basis.F
@@ -4483,6 +4483,8 @@ logical function bas_match_tags(tag_from_geom,basisin,btag)
character*16 b_elem ! basis set tag -> element name
integer b_atn ! basis set tag -> atomic number
logical debug ! true for extra output
+ logical bas_cmplcase
+ external bas_cmplcase
c
integer na2z
parameter (na2z = 26)
@@ -4511,10 +4513,10 @@ logical function bas_match_tags(tag_from_geom,basisin,btag)
c
c... first match full geometry tag to full basis tag list
c did the user specifically assign a tag ?
-
+c lowercase tags
nbtgs = infbs_head(HEAD_NTAGS,basis)
do i = 1, nbtgs
- if (gstring.eq.bs_tags(i,basis)) then
+ if (bas_cmplcase(gstring,bs_tags(i,basis))) then
bas_match_tags = .true.
btag = i
bsmatch = bs_tags(i,basis)
@@ -4564,7 +4566,7 @@ logical function bas_match_tags(tag_from_geom,basisin,btag)
lgstring = inp_strlen(gstring)
if (lgstring_old.gt.lgstring) then
do i = 1, nbtgs
- if (gstring.eq.bs_tags(i,basis)) then
+ if (bas_cmplcase(gstring,bs_tags(i,basis))) then
bas_match_tags = .true.
btag = i
bsmatch = bs_tags(i,basis)
@@ -4597,6 +4599,7 @@ logical function bas_match_tags(tag_from_geom,basisin,btag)
call errquit('bas_match_tags: fatal error ',911, BASIS_ERR)
endif
endif
+#if 0
if (g_elem.eq.b_elem) then
bas_match_tags = .true.
btag = i
@@ -4608,6 +4611,7 @@ logical function bas_match_tags(tag_from_geom,basisin,btag)
bsmatch = bs_tags(i,basis)
goto 00009
endif
+#endif
enddo
if (debug)
& write(luout,*)'bas_match_tags:debug: no match for tag <',
@@ -5757,4 +5761,27 @@ logical function bas_do_tags_match(tag_one,tag_two)
10000 format('bas_do_tags_match:debug: tag ',a16,
& ' matched this tag ',a16)
end
+ logical function bas_cmplcase(a,b)
+ implicit none
+ character*(*) a,b
+#include "inp.fh"
+ character*256 a_lcase,b_lcase
+ integer ipos
+c check for oniom sub string
+ if(inp_contains(.false.,'oniom',a,ipos)) then
+ a_lcase=a(1:ipos-1)
+ else
+ a_lcase=a
+ endif
+ call inp_lcase(a_lcase)
+c do not lowercase bqs
+ if (a_lcase(1:2).eq.'bq') a_lcase=a
+ b_lcase=b
+ call inp_lcase(b_lcase)
+ if (b_lcase(1:2).eq.'bq') b_lcase=b
+ bas_cmplcase=
+ A a_lcase(1:inp_strlen(a)).eq.
+ B b_lcase(1:inp_strlen(b))
+ return
+ end
C> @}
53 changes: 53 additions & 0 deletions easybuild/easyconfigs/n/NWChem/NWChem-7.2.3-iofbf-2023a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name = 'NWChem'
version = '7.2.3'

homepage = 'https://nwchemgit.github.io/'
description = """NWChem aims to provide its users with computational chemistry tools that are scalable both in
their ability to treat large scientific computational chemistry problems efficiently, and in their use of available
parallel computing resources from high-performance parallel supercomputers to conventional workstation clusters.
NWChem software can handle: biomolecules, nanostructures, and solid-state; from quantum to classical, and all
combinations; Gaussian basis functions or plane-waves; scaling from one to thousands of processors; properties
and relativity."""

toolchain = {'name': 'iofbf', 'version': '2023a'}
toolchainopts = {'i8': True}

source_urls = ['https://github.com/nwchemgit/nwchem/archive/refs/tags/',
'https://www.chemie.uni-bonn.de/grimme/de/software/dft-d3/']
sources = ['v%(version)s-release.tar.gz',
{'filename': 'dftd3.tgz',
'extract_cmd': 'cp -f %s %(builddir)s/nwchem-%(version)s-release/src/nwpw/nwpwlib/nwpwxc' }]
patches = [
'NWChem-7.0.2_fix_gnumakefile.patch',
'NWChem-7.2.3-PR-1042.patch'
]
checksums = [
{'v7.2.3-release.tar.gz': 'fec76fbe650cdab8b00c8c1d7a5671554313e04a8e9e2fb300a7aad486910e6f'},
{'dftd3.tgz': 'd97cf9758f61aa81fd85425448fbf4a6e8ce07c12e9236739831a3af32880f59'},
{'NWChem-7.0.2_fix_gnumakefile.patch': '89c634a652d4c8c358f8388ac01ee441659e3c0256c39b6494e2885c91f9aca4'},
{'NWChem-7.2.3-PR-1042.patch': '5d69fd67976a5a3a6a0d14a444812605141d0c2bf65e4af97ace44f541b8bd9d'},
]

dependencies = [
('GlobalArrays', '5.8.2'),
('Python', '3.11.5'),
]

preconfigopts = 'export EXTRA_LIBS=-lutil && '

buildopts = 'BLASOPT=-lflexiblas64_intel LAPACK_LIB=-lflexiblas64_intel SCALAPACK=-lscalapack64 '
buildopts += 'EXTERNAL_GA_PATH=$EBROOTGLOBALARRAYS '
buildopts += 'COPTIMIZE="$CFLAGS" FOPTIMIZE="$FFLAGS" '
buildopts += 'USE_SCALAPACK_I8=y BLAS_SIZE=8 LAPACK_SIZE=8 SCALAPACK_SIZE=8 FC="$F77" #'

modules = 'all python'

modloadmsg = """
------------------------------------------------------------------------------
This module includes a patch for the issue 475 reported at:
https://githubhot.com/repo/nwchemgit/nwchem/issues/475
Discrepancy between code and docs: D3 and D3(BJ) correction with B2PLYP #475
------------------------------------------------------------------------------
"""

moduleclass = 'chem'