Skip to content
Snippets Groups Projects
Commit aa86432e authored by Massimiliano Culpo's avatar Massimiliano Culpo Committed by Todd Gamblin
Browse files

patch directive : fixed retrieval from urls ( fixes #1584 ) (#2039)

* patch directive : fixed retrieval from urls fixes #1584

 - add support for 'gz' archives
 - fixed bugs with URL patches
 - updated nwchem

* patch directive : added checksum to UrlPatch

 - refactored classes in patch.py
 - updated nwchem

* patch directive : added caching
parent 8de143a9
Branches
Tags
No related merge requests found
Showing
with 121 additions and 7695 deletions
...@@ -259,7 +259,7 @@ def provides(pkg, *specs, **kwargs): ...@@ -259,7 +259,7 @@ def provides(pkg, *specs, **kwargs):
@directive('patches') @directive('patches')
def patch(pkg, url_or_filename, level=1, when=None): def patch(pkg, url_or_filename, level=1, when=None, **kwargs):
"""Packages can declare patches to apply to source. You can """Packages can declare patches to apply to source. You can
optionally provide a when spec to indicate that a particular optionally provide a when spec to indicate that a particular
patch should only be applied when the package's spec meets patch should only be applied when the package's spec meets
...@@ -271,7 +271,7 @@ def patch(pkg, url_or_filename, level=1, when=None): ...@@ -271,7 +271,7 @@ def patch(pkg, url_or_filename, level=1, when=None):
cur_patches = pkg.patches.setdefault(when_spec, []) cur_patches = pkg.patches.setdefault(when_spec, [])
# if this spec is identical to some other, then append this # if this spec is identical to some other, then append this
# patch to the existing list. # patch to the existing list.
cur_patches.append(Patch(pkg, url_or_filename, level)) cur_patches.append(Patch.create(pkg, url_or_filename, level, **kwargs))
@directive('variants') @directive('variants')
......
...@@ -286,6 +286,8 @@ def expand(self): ...@@ -286,6 +286,8 @@ def expand(self):
"URLFetchStrategy couldn't find archive file", "URLFetchStrategy couldn't find archive file",
"Failed on expand() for URL %s" % self.url) "Failed on expand() for URL %s" % self.url)
if not self.extension:
self.extension = extension(self.archive_file)
decompress = decompressor_for(self.archive_file, self.extension) decompress = decompressor_for(self.archive_file, self.extension)
# Expand all tarballs in their own directory to contain # Expand all tarballs in their own directory to contain
...@@ -313,7 +315,8 @@ def expand(self): ...@@ -313,7 +315,8 @@ def expand(self):
shutil.move(os.path.join(tarball_container, f), shutil.move(os.path.join(tarball_container, f),
os.path.join(self.stage.path, f)) os.path.join(self.stage.path, f))
os.rmdir(tarball_container) os.rmdir(tarball_container)
if not files:
os.rmdir(tarball_container)
# Set the wd back to the stage when done. # Set the wd back to the stage when done.
self.stage.chdir() self.stage.chdir()
......
...@@ -24,62 +24,106 @@ ...@@ -24,62 +24,106 @@
############################################################################## ##############################################################################
import os import os
from llnl.util.filesystem import join_path
import spack import spack
import spack.stage
import spack.error import spack.error
import spack.stage
import spack.fetch_strategy as fs
from llnl.util.filesystem import join_path
from spack.util.executable import which from spack.util.executable import which
# Patch tool for patching archives.
_patch = which("patch", required=True)
class Patch(object): class Patch(object):
"""This class describes a patch to be applied to some expanded """Base class to describe a patch that needs to be applied to some
source code.""" expanded source code.
"""
@staticmethod
def create(pkg, path_or_url, level, **kwargs):
"""
Factory method that creates an instance of some class derived from
Patch
Args:
pkg: package that needs to be patched
path_or_url: path or url where the patch is found
level: patch level
Returns:
instance of some Patch class
"""
# Check if we are dealing with a URL
if '://' in path_or_url:
return UrlPatch(pkg, path_or_url, level, **kwargs)
# Assume patches are stored in the repository
return FilePatch(pkg, path_or_url, level)
def __init__(self, pkg, path_or_url, level): def __init__(self, pkg, path_or_url, level):
self.pkg_name = pkg.name # Check on level (must be an integer > 0)
if not isinstance(level, int) or not level >= 0:
raise ValueError("Patch level needs to be a non-negative integer.")
# Attributes shared by all patch subclasses
self.path_or_url = path_or_url self.path_or_url = path_or_url
self.path = None
self.url = None
self.level = level self.level = level
# self.path needs to be computed by derived classes
# before a call to apply
self.path = None
if not isinstance(self.level, int) or not self.level >= 0: if not isinstance(self.level, int) or not self.level >= 0:
raise ValueError("Patch level needs to be a non-negative integer.") raise ValueError("Patch level needs to be a non-negative integer.")
if '://' in path_or_url:
self.url = path_or_url
else:
pkg_dir = spack.repo.dirname_for_package_name(self.pkg_name)
self.path = join_path(pkg_dir, path_or_url)
if not os.path.isfile(self.path):
raise NoSuchPatchFileError(pkg_name, self.path)
def apply(self, stage): def apply(self, stage):
"""Fetch this patch, if necessary, and apply it to the source """Apply the patch at self.path to the source code in the
code in the supplied stage. supplied stage
Args:
stage: stage for the package that needs to be patched
""" """
stage.chdir_to_source() stage.chdir_to_source()
# Use -N to allow the same patches to be applied multiple times.
_patch = which("patch", required=True)
_patch('-s', '-p', str(self.level), '-i', self.path)
class FilePatch(Patch):
"""Describes a patch that is retrieved from a file in the repository"""
def __init__(self, pkg, path_or_url, level):
super(FilePatch, self).__init__(pkg, path_or_url, level)
patch_stage = None pkg_dir = spack.repo.dirname_for_package_name(pkg.name)
try: self.path = join_path(pkg_dir, path_or_url)
if self.url: if not os.path.isfile(self.path):
# use an anonymous stage to fetch the patch if it is a URL raise NoSuchPatchFileError(pkg.name, self.path)
patch_stage = spack.stage.Stage(self.url)
patch_stage.fetch()
patch_file = patch_stage.archive_file class UrlPatch(Patch):
else: """Describes a patch that is retrieved from a URL"""
patch_file = self.path def __init__(self, pkg, path_or_url, level, **kwargs):
super(UrlPatch, self).__init__(pkg, path_or_url, level)
# Use -N to allow the same patches to be applied multiple times. self.url = path_or_url
_patch('-s', '-p', str(self.level), '-i', patch_file) self.md5 = kwargs.get('md5')
finally: def apply(self, stage):
if patch_stage: """Retrieve the patch in a temporary stage, computes
patch_stage.destroy() self.path and calls `super().apply(stage)`
Args:
stage: stage for the package that needs to be patched
"""
fetcher = fs.URLFetchStrategy(self.url, digest=self.md5)
mirror = join_path(
os.path.dirname(stage.mirror_path),
os.path.basename(self.url)
)
with spack.stage.Stage(fetcher, mirror_path=mirror) as patch_stage:
patch_stage.fetch()
patch_stage.check()
patch_stage.cache_local()
patch_stage.expand_archive()
self.path = os.path.abspath(
os.listdir(patch_stage.path).pop()
)
super(UrlPatch, self).apply(stage)
class NoSuchPatchFileError(spack.error.SpackError): class NoSuchPatchFileError(spack.error.SpackError):
......
...@@ -545,6 +545,10 @@ def chdir_to_source(self): ...@@ -545,6 +545,10 @@ def chdir_to_source(self):
def archive_file(self): def archive_file(self):
return self[0].archive_file return self[0].archive_file
@property
def mirror_path(self):
return self[0].mirror_path
class DIYStage(object): class DIYStage(object):
"""Simple class that allows any directory to be a spack stage.""" """Simple class that allows any directory to be a spack stage."""
......
...@@ -46,6 +46,9 @@ def decompressor_for(path, extension=None): ...@@ -46,6 +46,9 @@ def decompressor_for(path, extension=None):
path.endswith('.zip')): path.endswith('.zip')):
unzip = which('unzip', required=True) unzip = which('unzip', required=True)
return unzip return unzip
if extension and re.match(r'gz', extension):
gunzip = which('gunzip', required=True)
return gunzip
tar = which('tar', required=True) tar = which('tar', required=True)
tar.add_default_arg('-xf') tar.add_default_arg('-xf')
return tar return tar
......
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
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
--- 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
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;
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
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/)
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
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
Index: src/driver/opt_drv.F
===================================================================
--- src/driver/opt_drv.F (revision 28005)
+++ src/driver/opt_drv.F (revision 28006)
@@ -1641,7 +1641,7 @@
double precision lattice(6), scaler(3) ! periodic scaling
double precision dum1,dum2,dum3
double precision smalleig
- parameter (smalleig = 1.0d-4)
+ parameter (smalleig = 1.0d-8)
logical geom_print_zmatrix
external geom_print_zmatrix
logical ophigh
Index: src/tools/ga-5-4/gaf2c/gaf2c.c
===================================================================
--- src/tools/ga-5-4/gaf2c/gaf2c.c (revision 10630)
+++ src/tools/ga-5-4/gaf2c/gaf2c.c (revision 10631)
@@ -106,6 +106,7 @@
}
*argc = iargc;
*argv = iargv;
+ iargv[iargc] = 0;
}
Index: src/tools/ga-5-4/tcgmsg/fapi.c
===================================================================
--- src/tools/ga-5-4/tcgmsg/fapi.c (revision 10630)
+++ src/tools/ga-5-4/tcgmsg/fapi.c (revision 10631)
@@ -197,6 +197,7 @@
argv[i] = strdup(arg);
}
+ argv[argc] = 0;
tcgi_pbegin(argc, argv);
free(argv);
}
Index: src/util/util_mpinap.c
===================================================================
--- src/util/util_mpinap.c (revision 28079)
+++ src/util/util_mpinap.c (revision 28083)
@@ -17,7 +17,7 @@
#ifdef MPI
MPI_Comm_rank(MPI_COMM_WORLD,&myid);
#else
- myid=ga_nodeid_();
+ myid=GA_Nodeid();
#endif
sleeptime=(myid+1)/((long) *factor);
#ifdef DEBUG
Index: src/util/util_getppn.c
===================================================================
--- src/util/util_getppn.c (revision 28079)
+++ src/util/util_getppn.c (revision 28083)
@@ -8,6 +8,7 @@
#include <unistd.h>
#include <mpi.h>
#include "ga.h"
+#include "ga-mpi.h"
#include "typesf2c.h"
#if defined(__bgq__)
...@@ -44,26 +44,33 @@ class Nwchem(Package): ...@@ -44,26 +44,33 @@ class Nwchem(Package):
depends_on('python@2.7:2.8', type=nolink) depends_on('python@2.7:2.8', type=nolink)
# patches for 6.6-27746: # patches for 6.6-27746:
# TODO: add support for achived patches, i.e. urls_for_patches = {
# http://www.nwchem-sw.org/images/Tddft_mxvec20.patch.gz '@6.6': [
patch('Config_libs66.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Tddft_mxvec20.patch.gz', 'f91c6a04df56e228fe946291d2f38c9a'),
patch('Gcc6_optfix.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Tools_lib64.patch.gz', 'b71e8dbad27f1c97b60a53ec34d3f6e0'),
patch('Util_gnumakefile.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Config_libs66.patch.gz', 'cc4be792e7b5128c3f9b7b1167ade2cf'),
patch('cosmo_dftprint.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Cosmo_meminit.patch.gz', '1d94685bf3b72d8ecd40c46334348ca7'),
patch('cosmo_meminit.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Sym_abelian.patch.gz', 'b19cade61c787916a73a4aaf6e2445d6'),
patch('dplot_tolrho.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Xccvs98.patch.gz', 'b9aecc516a3551dcf871cb2f066598cb'),
patch('driver_smalleig.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Dplot_tolrho.patch.gz', '0a5bdad63d2d0ffe46b28db7ad6d9cec'),
patch('ga_argv.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Driver_smalleig.patch.gz', 'c3f609947220c0adb524b02c316b5564'),
patch('ga_defs.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Ga_argv.patch.gz', '7a665c981cfc17187455e1826f095f6f'),
patch('raman_displ.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Raman_displ.patch.gz', 'ed334ca0b2fe81ce103ef8cada990c4c'),
patch('sym_abelian.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Ga_defs.patch.gz', '0c3cab4d5cbef5acac16ffc5e6f869ef'),
patch('tddft_mxvec20.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Zgesvd.patch.gz', '8fd5a11622968ef4351bd3d5cddce8f2'),
patch('tools_lib64.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Cosmo_dftprint.patch.gz', '64dcf27f3c6ced2cadfb504fa66e9d08'),
patch('txs_gcc6.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Txs_gcc6.patch.gz', '56595a7252da051da13f94edc54fe059'),
patch('Util_getppn.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Gcc6_optfix.patch.gz', 'c6642c21363c09223784b47b8636047d'),
patch('xccvs98.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Util_gnumakefile.patch.gz', 'af74ea2e32088030137001ce5cb047c5'),
patch('zgesdv.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Util_getppn.patch.gz', '8dec8ee198bf5ec4c3a22a6dbf31683c'),
patch('Gcc6_macs_optfix.patch', when='@6.6', level=0) ('http://www.nwchem-sw.org/images/Gcc6_macs_optfix.patch.gz', 'a891a2713aac8b0423c8096461c243eb'),
('http://www.nwchem-sw.org/images/Notdir_fc.patch.gz', '2dc997d4ab3719ac7964201adbc6fd79')
]
}
# Iterate over patches
for condition, urls in urls_for_patches.iteritems():
for url, md5 in urls:
patch(url, when=condition, level=0, md5=md5)
def install(self, spec, prefix): def install(self, spec, prefix):
scalapack = spec['scalapack'].scalapack_libs scalapack = spec['scalapack'].scalapack_libs
......
Index: src/property/raman_input.F
===================================================================
--- src/property/raman_input.F (revision 28032)
+++ src/property/raman_input.F (revision 28033)
@@ -47,6 +47,7 @@
c
c set some defaults
c
+ field=' '
plot = 'normal' ! normal or resonance
line = 'lorentzian' ! lorentzian (l) or gaussian (g) lineshape
width = 20.0D+00 ! full-width at half maximum (FWHM) in 1/cm
@@ -54,7 +55,6 @@
hyperraman = .false. ! flag to calculate hyperaman terms
vroa = .false. ! flag to calculate vibrational raman spec
rmmodes = 0
- first = 7
last = 10000
low = 0.0D+00
high = 100000.0D+00
@@ -132,9 +132,9 @@
else if(inp_compare(.false.,'first',test)) then
if(.not. inp_i(first))
$ call errquit(pname//'missing value for first',911, INPUT_ERR)
- if (.not. rtdb_put(rtdb,'raman:first',mt_int,1,first))
- $ call errquit(pname//'rtdb put failed',0, RTDB_ERR)
-c --- determine first normal mode to use ---
+c --- not setting default here, it will be set later after
+c frequency calculation has been done so we know if we have
+c a linear molecule or not
else if(inp_compare(.false.,'last',test)) then
if(.not. inp_i(last)) ! FA-06-16-12 bug-fixed (BEF: first AFT: last)
$ call errquit(pname//'missing value for last',911, INPUT_ERR)
Index: src/property/task_raman.F
===================================================================
--- src/property/task_raman.F (revision 28032)
+++ src/property/task_raman.F (revision 28033)
@@ -59,6 +59,7 @@
integer j,pos,first0 ! FA-06-15-12
logical preraman ! FA-06-18-12
+ logical linear
character*32 pname
@@ -107,6 +108,12 @@
$ call errquit(pname//'rtdb_put freq_done',911, RTDB_ERR)
endif
c
+c --------Figure out if molecule is linear------------
+
+c if vib module doesn't list molecule as linear, assume it is not
+ if (.not. rtdb_get(rtdb,'vib:linear',mt_log,1,linear))
+ $ linear=.false.
+c
c --------Create/load reference geometry to get the number of atoms------------
if (.not.geom_create(geom,'geometry')) call errquit
@@ -116,7 +123,11 @@
if (.not. geom_ncent(geom,nat))
& call errquit(pname//'geom_ncent failed?',3, GEOM_ERR)
nc = nat*3
- rmmodes = nc-6
+ if (linear) then
+ rmmodes = nc-5
+ else
+ rmmodes = nc-6
+ end if
c if (ga_nodeid().eq.0) then
c write(*,1) nat,nc,rmmodes
@@ -146,8 +157,13 @@
$ low = 0.0D+00 ! lowest wavenumber normal mode to use
if (.not. rtdb_get(rtdb,'raman:high',mt_dbl,1,high))
$ high = 100000.0D+00 ! Highest wavenumber normal mode to use
- if (.not. rtdb_get(rtdb,'raman:first',mt_int,1,first))
- $ first = 7 ! first normal mode to use
+ if (.not. rtdb_get(rtdb,'raman:first',mt_int,1,first)) then
+ if (linear) then
+ first = 6 ! first normal mode to use
+ else
+ first = 7 ! first normal mode to use
+ end if
+ end if
if (.not. rtdb_get(rtdb,'raman:last',mt_int,1,last))
$ last = 10000 ! last normal mode to use
if (.not. rtdb_get(rtdb,'raman:hyperraman',mt_log,1,hyperraman))
@@ -156,7 +172,11 @@
$ vroa = .false. ! # flag to calculate vibrational
if (.not. rtdb_get(rtdb,'raman:preraman',mt_log,1,preraman))
$ preraman = .false. ! # flag to do task_freq() and leave
- first0=7 ! constant
+ if (linear) then
+ first0=6 ! constant
+ else
+ first0=7 ! constant
+ end if
c ======== FA-debug =============== START
c if (ga_nodeid().eq.0) then
c write(*,2) plot,line,width,step_size,steps
@@ -172,8 +192,13 @@
rmmodes = nc
c
c --- in case we want overide the defaults for modes to include ---
- if (.not. rtdb_get(rtdb,'raman:first',mt_int,1,first))
- $ first = 7 ! srtep size for displacement along modes
+ if (.not. rtdb_get(rtdb,'raman:first',mt_int,1,first)) then
+ if (linear) then
+ first = 6 ! srtep size for displacement along modes
+ else
+ first = 7 ! srtep size for displacement along modes
+ end if
+ end if
endif
c
c ----------alocate space for freq and normal modes----------------------------
@@ -294,7 +319,7 @@
c ------------enough setup really do the calculation------------------------
if (.not.preraman) then
call task_raman_doit(rtdb,geom,nc,nat,
- & first0, ! = 7 constant
+ & first0, ! = 6 or 7
& first,last,rmmodes,
& steps,nfreq,plot,line,width,
& step_size,
@@ -336,7 +361,7 @@
c
c == perform raman calculation ==
subroutine task_raman_doit(rtdb,geom,nc,nat,
- & first0, ! = 7 constant
+ & first0, ! = 6 or 7
& first,last,rmmodes,
& steps,nfreq,
& plot,line,width,
@@ -495,7 +520,7 @@
& lbl_raman, ! in: raman label
& begin, ! in:
& last, ! in:
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -519,7 +544,7 @@
& lbl_raman, ! in: raman label
& mode_ini, ! in:
& mode_end, ! in:
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -541,7 +566,7 @@
& lbl_raman, ! in: raman label
& begin, ! in: starting mode
& last, ! in: ending mode
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -596,7 +621,7 @@
& rmmodes, ! in: total nr. modes
& rminfo, ! in: stores raman info
& nc,nat, ! in: (nc,nat)=(nr coord,nr atoms)
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -757,7 +782,8 @@
& step_size,
& rminfo,
& eigenvecs,
- & mass)
+ & mass,
+ & first0)
c ======== FA: Writing to file rminfo ========= START
c if (ga_nodeid().eq.0)
c & write(*,*) 'BEF raman_write() ...'
@@ -783,7 +809,7 @@
& lbl_raman, ! in: raman label
& begin, ! in: starting mode
& last, ! in: ending mode
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -890,7 +916,7 @@
& rmmodes, ! in: total nr. modes
& rminfo, ! in: stores raman info
& nc,nat, ! in: (nc,nat)=(nr coord,nr atoms)
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -915,7 +941,7 @@
& lbl_raman, ! in: raman label
& mode_ini, ! in:
& mode_end, ! in:
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -1036,7 +1062,7 @@
& rmmodes, ! in: total nr. modes
& rminfo, ! in: stores raman info
& nc,nat, ! in: (nc,nat)=(nr coord,nr atoms)
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -1058,7 +1084,7 @@
& lbl_raman, ! in: raman label
& begin, ! in:
& last, ! in:
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
@@ -1139,7 +1165,7 @@
& rmmodes, ! in: total nr. modes
& rminfo, ! in: stores raman info
& nc,nat, ! in: (nc,nat)=(nr coord,nr atoms)
- & first0, ! in: = 7 constant
+ & first0, ! in: = 6 or 7
& eigenvecs, ! in: hessian data (modes)
& eigenvals, ! in: hessian data (frequencies)
& mass, ! in: mass(i) i=1,nat
Index: src/property/raman.F
===================================================================
--- src/property/raman.F (revision 28032)
+++ src/property/raman.F (revision 28033)
@@ -29,8 +29,8 @@
integer rtdb ! [input] rtdb handle
integer natom ! [input] number of atoms
integer nat3 ! [input] 3*number of atoms
- integer first ! first mode to consider in aoresponse (default =7 ramana =1 hyperraman)
- integer tmpmode ! set to fill rminfo from 1 ( not 7 for raman calc)
+ integer first ! first mode to consider in aoresponse (default =6 or 7 raman =1 hyperraman)
+ integer tmpmode ! set to fill rminfo from 1 ( not 6 or 7 for raman calc)
integer rmmodes ! # of raman active modes
double precision rminfo(rmmodes,4) ! data for raman spec
@@ -41,6 +41,10 @@
double precision ncoords(3,natom) ! [scratch] coords after step
double precision steps(3,natom) ! [scratch] step generated by vector and scaled
c
+ double precision length_of_step, scale
+ double precision ddot
+ external ddot
+c
parameter (bohr2ang=0.52917724924D+00) ! CONVERSION OF BOHR to ANGSTROMS
c -------------determine sign of the step---------------------------------
if (iii.eq.1) then
@@ -57,13 +61,16 @@
c & i4,',',i4,',',i4,',',i4,',',f15.8,')')
c ======= FA-check rminfo(x,1) ======== END
c --------------------------------------------------------------------
- ivec = 1
- do iatom = 1,natom
- do ixyz = 1,3
- steps(ixyz,iatom)=sign*step_size*eigenvecs(ivec,imode)
- ivec = ivec + 1
- enddo ! ixyz
- enddo ! iatom
+ ivec = 1
+ do iatom = 1,natom
+ do ixyz = 1,3
+ steps(ixyz,iatom)=eigenvecs(ivec,imode)
+ ivec = ivec + 1
+ enddo ! ixyz
+ enddo ! iatom
+ length_of_step = sqrt(ddot(nat3,steps,1,steps,1))
+ scale = sign*step_size/length_of_step
+ call dscal(nat3,scale,steps,1)
call daxpy(nat3,1.0d00,steps,1,ncoords,1) ! mult coords
if (.not. geom_cart_coords_set(geom,ncoords))
@@ -85,7 +92,8 @@
& step_size,! in : step of finite differencing
& rminfo, ! in : Raman data
& eigenvecs,! in : normal modes eigenvectors (nat3,nat3)
- & mass) ! in : mass
+ & mass, ! in : mass
+ & first0) ! in : first nonzero mode (6 or 7)
c
c Authors: Jonathan Mullin, Northwestern University (ver 1: Jan. 2011)
c Fredy W. Aquino, Northwestern University (ver 2: Oct. 2012)
@@ -108,6 +116,7 @@
integer imode ! mode #
integer natom ! [input] number of atoms
integer nat3 ! [input] 3*number of atoms
+ integer first0 ! [input] first nonzero mode (6 or 7)
c
double precision rminfo(rmmodes,4) ! raman data
double precision step_size,stepsize ! [input] step of finite differencing
@@ -134,7 +143,7 @@
call dfill(3*natom,0.0D+00,tmode,1) !
c zero
stepsize = zero
- m = imode - 6
+ m = imode - first0 + 1
j=1
i=1
ar2 = zero ! alpha real
Index: src/symmetry/sym_abelian.F
===================================================================
--- src/symmetry/sym_abelian.F (revision 27901)
+++ src/symmetry/sym_abelian.F (revision 27902)
@@ -10,9 +10,11 @@
c
character*8 group
integer nab, ind
- parameter (nab = 8)
+ parameter (nab = 18)
character*4 ab(nab)
- data ab/ 'C1','Cs','Ci','C2','D2','C2v','C2h','D2h'/
+ data ab/ 'C1','Cs','Ci','C2','D2','C2v','C2h','D2h',
+ C 'C3','C4','C5','C6','C7','C8',
+ C 'C3h','C4h','C5h','C6h'/
c
call sym_group_name(geom, group)
c
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment