Skip to content

Commit

Permalink
Merge pull request #1575 from davydden/pkg/nwchem
Browse files Browse the repository at this point in the history
nwchem: add new package
  • Loading branch information
tgamblin committed Aug 24, 2016
2 parents 5cfa748 + d154f15 commit 63859bf
Show file tree
Hide file tree
Showing 20 changed files with 8,508 additions and 0 deletions.
46 changes: 46 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/Config_libs66.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Index: src/config/makefile.h
===================================================================
--- src/config/makefile.h (revision 27729)
+++ src/config/makefile.h (revision 27844)
@@ -2257,11 +2258,7 @@
DEFINES += -DFDIST
endif

-_TOOLS_BUILD= $(shell [ -e ${NWCHEM_TOP}/src/tools/build/config.h ] && cat ${NWCHEM_TOP}/src/tools/build/config.h | awk ' /HAVE_SQRT/ {print "Y"}')
-
-ifeq ($(_TOOLS_BUILD),Y)
_USE_SCALAPACK = $(shell cat ${NWCHEM_TOP}/src/tools/build/config.h | awk ' /HAVE_SCALAPACK\ 1/ {print "Y"}')
-endif

ifeq ($(_USE_SCALAPACK),Y)
DEFINES += -DSCALAPACK
@@ -2286,8 +2283,8 @@
-brename:.pdgetrf_,.pdgetrf \
-brename:.pdgetrs_,.pdgetrs
endif
- CORE_LIBS += $(ELPA) $(SCALAPACK) $(PBLAS) $(BLACS)
endif
+ CORE_LIBS += $(ELPA) $(SCALAPACK)

ifdef USE_64TO32
CORE_LIBS += -l64to32
@@ -2436,18 +2433,11 @@
DEFINES += -DUSE_F90_ALLOCATABLE
endif

-ifeq ($(_TOOLS_BUILD),Y)
# lower level libs used by communication libraries
COMM_LIBS= $(shell grep ARMCI_NETWORK_LIBS\ = ${NWCHEM_TOP}/src/tools/build/Makefile | cut -b 22-)
COMM_LIBS += $(shell grep ARMCI_NETWORK_LDFLAGS\ = ${NWCHEM_TOP}/src/tools/build/Makefile | cut -b 24-)
#comex bit
-HAVE_COMEX = $(shell [ -e ${NWCHEM_TOP}/src/tools/build/comex/config.h ] && cat ${NWCHEM_TOP}/src/tools/build/comex/config.h| grep COMEX_NETWORK| awk ' / 1/ {print "Y"}')
-ifeq ($(HAVE_COMEX),Y)
-COMM_LIBS += $(shell grep LIBS\ = ${NWCHEM_TOP}/src/tools/build/comex/Makefile|grep -v _LIBS| cut -b 8-)
-#we often need pthread, let's add it
-COMM_LIBS += -lpthread
-endif
-endif
+COMM_LIBS += $(shell [ -e ${NWCHEM_TOP}/src/tools/build/comex/config.h ] && grep LIBS\ = ${NWCHEM_TOP}/src/tools/build/comex/Makefile|grep -v _LIBS| cut -b 8-) -lpthread
ifdef COMM_LIBS
CORE_LIBS += $(COMM_LIBS)
endif
40 changes: 40 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/Gcc6_macs_optfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Index: src/config/makefile.h
===================================================================
--- src/config/makefile.h (revision 28470)
+++ src/config/makefile.h (revision 28471)
@@ -910,6 +910,7 @@
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | egrep __VERS | cut -c24)
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
+ GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6 ] && echo true)
endif
ifeq ($(GNU_GE_4_6),true)
DEFINES += -DGCC46
@@ -921,6 +922,9 @@

FOPTIONS += -Warray-bounds
endif
+ ifeq ($(GNU_GE_6),true)
+ FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
+ endif
ifdef USE_OPENMP
FOPTIONS += -fopenmp
LDOPTIONS += -fopenmp
@@ -1067,6 +1071,7 @@
GNUMINOR=$(shell $(FC) -dM -E - < /dev/null 2> /dev/null | egrep __VERS | cut -c24)
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
+ GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6 ] && echo true)
ifeq ($(GNU_GE_4_6),true)
DEFINES += -DGCC46
endif
@@ -1076,6 +1081,9 @@
#gone FFLAGS_FORGA += -fno-aggressive-loop-optimizations
FOPTIONS += -Warray-bounds
endif # GNU_GE_4_8
+ ifeq ($(GNU_GE_6),true)
+ FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
+ endif
endif # GNUMAJOR

ifdef USE_OPENMP
21 changes: 21 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/Gcc6_optfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- src/config/makefile.h.orig 2016-07-22 08:45:52.100229544 -0700
+++ src/config/makefile.h 2016-07-22 08:49:00.321422169 -0700
@@ -1565,6 +1565,7 @@
GNU_GE_4_6 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 6 \) ] && echo true)
GNU_GE_4_8 = $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
endif
+ GNU_GE_6 = $(shell [ $(GNUMAJOR) -ge 6 ] && echo true)
ifeq ($(GNU_GE_4_6),true)
DEFINES += -DGCC46
endif
@@ -1942,6 +1943,10 @@
FOPTIMIZE += -O3
FOPTIMIZE += -mfpmath=sse -ffast-math
FOPTIMIZE += -fprefetch-loop-arrays #-ftree-loop-linear
+ ifeq ($(GNU_GE_6),true)
+ FOPTIMIZE += -fno-tree-dominator-opts # solvation/hnd_cosmo_lib breaks
+ endif
+
ifeq ($(GNU_GE_4_8),true)
FOPTIMIZE += -ftree-vectorize -fopt-info-vec
endif
15 changes: 15 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/Util_getppn.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Index: src/util/util_getppn.c
===================================================================
--- src/util/util_getppn.c (revision 27443)
+++ src/util/util_getppn.c (working copy)
@@ -32,7 +33,9 @@
void FATR util_getppn_(Integer *ppn_out){

#if defined(__bgq__)
- *ppn_out = Kernel_ProcessCount();
+ *ppn_out = (Integer) Kernel_ProcessCount();
+ return;
+ if(0) {
#elif MPI_VERSION >= 3

int err;
21 changes: 21 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/Util_gnumakefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Index: src/util/GNUmakefile
===================================================================
--- src/util/GNUmakefile (revision 27774)
+++ src/util/GNUmakefile (revision 27782)
@@ -234,7 +234,7 @@

USES_BLAS = util.fh ga_it_lsolve.F ga_maxelt.F ga_mix.F ga_iter_diag.F \
ga_orthog.F dabsmax.F ga_normf.F corr_mk_ref.F ga_it2.F ga_lkain_ext.F util_file_name.F dgefa.f util_patch_test.F stpr_sjacobi.F util_dgeev.F \
- util_test_cholesky.F
+ util_test_cholesky.F dfill.f ga_lkain_2cpl3_ext.F ga_it2.F

ifdef SPEECH
LIB_DEFINES += -DSPEECH
@@ -254,6 +254,7 @@
ifeq ($(TARGET),$(findstring $(TARGET),BGL BGP BGQ))
DEFINES += -DNEED_LOC
LIB_DEFINES += -DNO_UTIL_TESTS
+LIB_DEFINES += -I/bgsys/drivers/ppcfloor/firmware/include -I/bgsys/drivers/ppcfloor/spi/include/kernel
endif

ifdef SLURM
26 changes: 26 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/cosmo_dftprint.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Index: src/nwdft/scf_dft/dft_scf.F
===================================================================
--- src/nwdft/scf_dft/dft_scf.F (revision 28116)
+++ src/nwdft/scf_dft/dft_scf.F (revision 28117)
@@ -1884,6 +1884,13 @@
if (abs(Edisp).gt.0.0d0) then
write(LuOut,224)Edisp
endif
+ if (cosmo_on.and.cosmo_phase.eq.2) then
+ if (do_cosmo_smd) then
+ write(LuOut,225) ecosmo+gcds
+ else
+ write(LuOut,225) ecosmo
+ end if
+ endif
if (do_zora) write(luout,2221) ener_scal
write(luout,2222) rho_n
write(luout,2223) dft_time
@@ -2457,6 +2464,7 @@
& ' Correlation energy =', f22.12/
& ' Nuclear repulsion energy =', f22.12/)
224 format(' Dispersion correction =', f22.12/)
+ 225 format(' COSMO energy =', f22.12/)
c
2221 format(' Scaling correction =', f22.12/)
2222 format(' Numeric. integr. density =', f22.12/)
172 changes: 172 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/cosmo_meminit.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
Index: src/solvation/hnd_cosmo_lib.F
===================================================================
--- src/solvation/hnd_cosmo_lib.F (revision 27880)
+++ src/solvation/hnd_cosmo_lib.F (revision 27881)
@@ -92,26 +92,32 @@
c & i_init,init))
c & call errquit('hnd_cosset, malloc of init failed',911,MA_ERR)
c
- stat = .true.
- stat = stat.and.ma_push_get(mt_dbl,3*nat,"xyzatm",l_i10,i10)
- stat = stat.and.ma_push_get(mt_dbl, nat,"ratm",l_i20,i20)
- stat = stat.and.ma_push_get(mt_int, nat,"nspa",l_i30,i30)
- stat = stat.and.ma_push_get(mt_int, nat,"nppa",l_i40,i40)
- stat = stat.and.ma_push_get(mt_int,3*mxface,"ijkfac",l_i50,i50)
- stat = stat.and.ma_push_get(mt_dbl,3*mxface,"xyzseg",l_i60,i60)
- stat = stat.and.ma_push_get(mt_int, mxface,"ijkseg",l_i70,i70)
- stat = stat.and.ma_push_get(mt_log, mxface*nat,"insseg",
- & l_i80,i80)
- stat = stat.and.ma_push_get(mt_dbl,3*mxface*nat,"xyzspa",
- & l_i90,i90)
- stat = stat.and.ma_push_get(mt_int, mxface*nat,"ijkspa",
- & l_i100,i100)
- stat = stat.and.ma_push_get(mt_int, mxface*nat,"numpps",
- & l_i110,i110)
- stat = stat.and.ma_push_get(mt_dbl,3*mxapex ,"apex",
- & l_i120,i120)
- stat = stat.and.ma_push_get(mt_dbl, mxface*nat,"xyzff",
- & l_i130,i130)
+ if(.not.ma_push_get(mt_dbl,3*nat,"xyzatm",l_i10,i10))
+ c call errquit('hndcosset: not enuf mem',0,MA_ERR)
+ if(.not.ma_push_get(mt_dbl, nat,"ratm",l_i20,i20))
+ c call errquit('hndcosset: not enuf mem',1,MA_ERR)
+ if(.not.ma_push_get(mt_int, nat,"nspa",l_i30,i30))
+ c call errquit('hndcosset: not enuf mem',2,MA_ERR)
+ if(.not.ma_push_get(mt_int, nat,"nppa",l_i40,i40))
+ c call errquit('hndcosset: not enuf mem',3,MA_ERR)
+ if(.not.ma_push_get(mt_int,3*mxface,"ijkfac",l_i50,i50))
+ c call errquit('hndcosset: not enuf mem',4,MA_ERR)
+ if(.not.ma_push_get(mt_dbl,3*mxface,"xyzseg",l_i60,i60))
+ c call errquit('hndcosset: not enuf mem',5,MA_ERR)
+ if(.not.ma_push_get(mt_int, mxface,"ijkseg",l_i70,i70))
+ c call errquit('hndcosset: not enuf mem',6,MA_ERR)
+ if(.not.ma_push_get(mt_log, mxface*nat,"insseg",l_i80,i80))
+ c call errquit('hndcosset: not enuf mem',7,MA_ERR)
+ if(.not.ma_push_get(mt_dbl,3*mxface*nat,"xyzspa",l_i90,i90))
+ c call errquit('hndcosset: not enuf mem',8,MA_ERR)
+ if(.not.ma_push_get(mt_int, mxface*nat,"ijkspa",l_i100,i100))
+ c call errquit('hndcosset: not enuf mem',9,MA_ERR)
+ if(.not.ma_push_get(mt_int, mxface*nat,"numpps",l_i110,i110))
+ c call errquit('hndcosset: not enuf mem',10,MA_ERR)
+ if(.not.ma_push_get(mt_dbl,3*mxapex ,"apex",l_i120,i120))
+ c call errquit('hndcosset: not enuf mem',11,MA_ERR)
+ if(.not.ma_push_get(mt_dbl, mxface*nat,"xyzff",l_i130,i130))
+ c call errquit('hndcosset: not enuf mem',12,MA_ERR)
c i10 =init ! xyzatm(3,nat)
c i20 =i10 +3*nat ! ratm( nat)
c i30 =i20 + nat ! nspa( nat)
@@ -129,9 +135,10 @@
c
call hnd_cossrf(nat,c,radius,nat,mxface,mxapex,
1 dbl_mb(i10),dbl_mb(i20),int_mb(i30),int_mb(i40),
- 2 int_mb(i50),dbl_mb(i60),int_mb(i70),
- 3 log_mb(i80),dbl_mb(i90),int_mb(i100),int_mb(i110),
+ 2 int_mb(i50),dbl_mb(i60),int_mb(i70),log_mb(i80),
+ 3 dbl_mb(i90),int_mb(i100),int_mb(i110),
4 dbl_mb(i120),dbl_mb(i130),rtdb)
+
c
c ----- release memory block -----
c
@@ -157,7 +164,7 @@
#include "global.fh"
#include "stdio.fh"
#include "cosmoP.fh"
-c
+#include "mafdecls.fh"
integer rtdb, nat
integer mxatm
integer mxfac
@@ -261,6 +268,7 @@
c
c ----- create -solvent accessible surface- of the molecule -----
c
+
call hnd_cossas(nat,xyzatm,ratm,mxatm,
1 nspa,nppa,xyzspa,ijkspa,
2 nseg,nfac,xyzseg,ijkseg,insseg,
@@ -366,6 +374,7 @@
#include "stdio.fh"
#include "bq.fh"
#include "prop.fh"
+cnew
#include "cosmoP.fh"
c
integer rtdb !< [Input] The RTDB handle
@@ -410,7 +419,6 @@
integer numpps( mxface,mxatom)
double precision xyzff( mxface,mxatom)
double precision zero, one
- data zero /0.0d+00/
data one /1.0d+00/
integer l_efcc, k_efcc, l_efcs, k_efcs, l_efcz, k_efcz
integer l_efclb, k_efclb, k_efciat, l_efciat
@@ -464,7 +472,7 @@
do i=1,mxface
ijkspa(i,iat)=0
numpps(i,iat)=0
- xyzff(i,iat)=zero
+ xyzff(i,iat)=0d0
enddo
enddo
c
@@ -473,7 +481,7 @@
c
do iat=1,nat
c
- if(ratm(iat).ne.zero) then
+ if(ratm(iat).ne.0d0) then
do iseg=1,nseg
ijkspa(iseg,iat)=ijkseg(iseg)
xyzff(iseg,iat)=one
@@ -515,7 +523,7 @@
enddo
endif
else if (do_cosmo_model.eq.DO_COSMO_YK) then
- if((jat.ne.iat).and.(ratm(jat).ne.zero)
+ if((jat.ne.iat).and.(ratm(jat).ne.0d0)
1 .and.(dij.lt.(ratm(iat)+rout(jat)))) then
do iseg=1,nseg
dum=dist(xyzspa(1,iseg,iat),
@@ -615,7 +623,7 @@
c
nefc = 0
do iat=1,nat
- if(ratm(iat).ne.zero) then
+ if(ratm(iat).ne.0d0) then
do iseg=1,nseg
if(.not.insseg(iseg,iat)) nefc = nefc+1
enddo
@@ -639,11 +647,11 @@
c save segment surfaces
c save segment to atom mapping
c
- srfmol=zero
- volmol=zero
+ srfmol=0d0
+ volmol=0d0
ief =0
do iat=1,nat
- if(ratm(iat).ne.zero) then
+ if(ratm(iat).ne.0d0) then
if (do_cosmo_model.eq.DO_COSMO_KS) then
ratm_real=ratm(iat)-rsolv/bohr
else if (do_cosmo_model.eq.DO_COSMO_YK) then
@@ -720,7 +728,7 @@
endif
c
do ief=1,nefc
- dbl_mb(k_efcz+ief-1)=zero
+ dbl_mb(k_efcz+ief-1)=0d0
enddo
do ief=1,nefc
byte_mb(k_efclb+(ief-1)*8)=' '
@@ -877,6 +885,8 @@
implicit double precision (a-h,o-z)
#include "global.fh"
#include "stdio.fh"
+cnew
+#include "cosmoP.fh"
c
c ----- starting from -icosahedron- -----
c
45 changes: 45 additions & 0 deletions var/spack/repos/builtin/packages/nwchem/dplot_tolrho.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Index: src/dplot/dplot_input.F
===================================================================
--- src/dplot/dplot_input.F (revision 27986)
+++ src/dplot/dplot_input.F (revision 27987)
@@ -63,6 +63,7 @@
iroot = 1
ltransden = .true.
ldiffden = .false.
+ tol_rho = 1d-40
c
c try to get a scf movecs
c
@@ -263,10 +264,10 @@
goto 10
c
1998 continue
- tol_rho = 1d-15
If (.not. inp_f(tol_rho))
& Call ErrQuit('DPlot_Input: failed to read tol_rho',0,
& INPUT_ERR)
+ tol_rho=max(1d-99,tol_rho)
goto 10
c
1999 continue
Index: src/dplot/dplot_dump.F
===================================================================
--- src/dplot/dplot_dump.F (revision 27986)
+++ src/dplot/dplot_dump.F (revision 27987)
@@ -90,7 +90,7 @@
. No_Of_Spacings(3))
99498 format(6E13.5)
enddo
- else
+ else
Do i = 1, nGrid
Write(Out_Unit,'(f15.10)')values(i)
End Do
@@ -107,6 +107,7 @@
End Do
AppCh = Sum*Volume
Write(LuOut,*)
+ Write(LuOut,'(a,e30.5)')' Tol_rho = ',tol_rho
Write(LuOut,'(a,f30.5)')' Sum of elements = ',sum
Write(LuOut,'(a,f30.5)')' Integration volume = ',volume
Write(LuOut,'(a,f30.5)')' Integrated Charge = ',AppCh

0 comments on commit 63859bf

Please sign in to comment.