Merge pull request #614 from akohlmey/fixes-for-stable

Fixes for stable
This commit is contained in:
Steve Plimpton 2017-08-11 08:35:20 -06:00 committed by GitHub
commit b209a4e246
9 changed files with 95 additions and 30 deletions

View File

@ -45,12 +45,12 @@ while iarg < nargs:
if args[iarg] == "-m":
if iarg+2 > len(args): error()
machine = args[iarg+1]
iarg += 2
iarg += 2
elif args[iarg] == "-e":
if iarg+2 > len(args): error()
extraflag = True
suffix = args[iarg+1]
iarg += 2
iarg += 2
else: error()
# set lib from working dir

View File

@ -14,7 +14,7 @@ Syntax from lib dir: python Install.py -m machine -h hdir -a arch -p precision -
specify one or more options, order does not matter
copies an existing Makefile.machine in lib/gpu to Makefile.auto
copies an existing Makefile.machine in lib/gpu to Makefile.auto
optionally edits these variables in Makefile.auto:
CUDA_HOME, CUDA_ARCH, CUDA_PRECISION, EXTRAMAKE
optionally uses Makefile.auto to build the GPU library -> libgpu.a
@ -26,7 +26,7 @@ optionally copies Makefile.auto to a new Makefile.osuffix
-h = set CUDA_HOME variable in Makefile.auto to hdir
hdir = path to NVIDIA Cuda software, e.g. /usr/local/cuda
-a = set CUDA_ARCH variable in Makefile.auto to arch
use arch = 20 for Tesla C2050/C2070 (Fermi) (deprecated as of CUDA 8.0)
use arch = 20 for Tesla C2050/C2070 (Fermi) (deprecated as of CUDA 8.0)
or GeForce GTX 580 or similar
use arch = 30 for Tesla K10 (Kepler)
use arch = 35 for Tesla K40 (Kepler) or GeForce GTX Titan or similar
@ -108,10 +108,10 @@ if pflag:
elif precision == "mixed": precstr = "-D_SINGLE_DOUBLE"
elif precision == "single": precstr = "-D_SINGLE_SINGLE"
else: error("Invalid precision setting")
# create Makefile.auto
# reset EXTRAMAKE, CUDA_HOME, CUDA_ARCH, CUDA_PRECISION if requested
if not os.path.exists("Makefile.%s" % isuffix):
error("lib/gpu/Makefile.%s does not exist" % isuffix)

View File

@ -6,6 +6,8 @@
from __future__ import print_function
import sys,os,re,subprocess
# help message
help = """
Syntax from src dir: make lib-kim args="-b -v version -a kim-name"
or: make lib-kim args="-b -a everything"
@ -23,7 +25,7 @@ specify one or more options, order does not matter
-b = download and build base KIM API library with example Models
this will delete any previous installation in the current folder
-n = do NOT download and build base KIM API library.
Use an existing installation
Use an existing installation
-p = specify location of KIM API installation (implies -n)
-a = add single KIM model or model driver with kim-name
to existing KIM API lib (see example below).
@ -78,13 +80,27 @@ def which(program):
return None
def geturl(url,fname):
success = False
if which('curl') != None:
cmd = 'curl -L -o "%s" %s' % (fname,url)
elif which('wget') != None:
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling curl failed with: %s" % e.output.decode('UTF-8'))
if not success and which('wget') != None:
cmd = 'wget -O "%s" %s' % (fname,url)
else: error("cannot find 'wget' or 'curl' to download source code")
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
return txt
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling wget failed with: %s" % e.output.decode('UTF-8'))
if not success:
error("Failed to download source code with 'curl' or 'wget'")
return
# parse args

View File

@ -65,13 +65,27 @@ def which(program):
return None
def geturl(url,fname):
success = False
if which('curl') != None:
cmd = 'curl -L -o "%s" %s' % (fname,url)
elif which('wget') != None:
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling curl failed with: %s" % e.output.decode('UTF-8'))
if not success and which('wget') != None:
cmd = 'wget -O "%s" %s' % (fname,url)
else: error("cannot find 'wget' or 'curl' to download source code")
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
return txt
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling wget failed with: %s" % e.output.decode('UTF-8'))
if not success:
error("Failed to download source code with 'curl' or 'wget'")
return
# parse args

View File

@ -65,13 +65,27 @@ def which(program):
return None
def geturl(url,fname):
success = False
if which('curl') != None:
cmd = 'curl -L -o "%s" %s' % (fname,url)
elif which('wget') != None:
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling curl failed with: %s" % e.output.decode('UTF-8'))
if not success and which('wget') != None:
cmd = 'wget -O "%s" %s' % (fname,url)
else: error("cannot find 'wget' or 'curl' to download source code")
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
return txt
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling wget failed with: %s" % e.output.decode('UTF-8'))
if not success:
error("Failed to download source code with 'curl' or 'wget'")
return
# parse args

View File

@ -64,13 +64,27 @@ def which(program):
return None
def geturl(url,fname):
success = False
if which('curl') != None:
cmd = 'curl -L -o "%s" %s' % (fname,url)
elif which('wget') != None:
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling curl failed with: %s" % e.output.decode('UTF-8'))
if not success and which('wget') != None:
cmd = 'wget -O "%s" %s' % (fname,url)
else: error("cannot find 'wget' or 'curl' to download source code")
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
return txt
try:
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
success = True
except subprocess.CalledProcessError as e:
print("Calling wget failed with: %s" % e.output.decode('UTF-8'))
if not success:
error("Failed to download source code with 'curl' or 'wget'")
return
# parse args

View File

@ -339,17 +339,18 @@ no-%:
fi;
# download/build/install a package library
# update the timestamp on main.cpp to trigger a relink with "make machine"
lib-%:
@if [ -e ../lib/$(LIBDIR)/Install.py ]; then \
echo "Installing lib $(@:lib-%=%)"; \
cd ../lib/$(LIBDIR); $(PYTHON) Install.py $(args); \
( cd ../lib/$(LIBDIR); $(PYTHON) Install.py $(args) ); \
elif [ -e ../lib/$(LIBUSERDIR)/Install.py ]; then \
echo "Installing lib $(@:lib-user-%=%)"; \
cd ../lib/$(LIBUSERDIR); $(PYTHON) Install.py $(args); \
( cd ../lib/$(LIBUSERDIR); $(PYTHON) Install.py $(args) ); \
else \
echo "Install script for lib $(@:lib-%=%) does not exist"; \
fi;
fi; touch main.cpp
# status = list src files that differ from package files
# update = replace src files with newer package files

View File

@ -75,7 +75,7 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp)
ewaldflag = pppmflag = msmflag = dispersionflag = tip4pflag = dipoleflag = 0;
reinitflag = 1;
// pair_modify settingsx
// pair_modify settings
compute_flag = 1;
manybody_flag = 0;

View File

@ -36,7 +36,7 @@ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp),
map(NULL), special_lj(NULL), special_coul(NULL), compute_tally(NULL)
{
nstyles = 0;
outerflag = 0;
respaflag = 0;
@ -490,7 +490,7 @@ void PairHybrid::init_style()
if (((force->special_lj[i] == 0.0) || (force->special_lj[i] == 1.0))
&& (force->special_lj[i] != special_lj[istyle][i]))
error->all(FLERR,"Pair_modify special setting for pair hybrid "
"incompatible with global special_bonds setting");
"incompatible with global special_bonds setting");
}
}
@ -500,7 +500,7 @@ void PairHybrid::init_style()
|| (force->special_coul[i] == 1.0))
&& (force->special_coul[i] != special_coul[istyle][i]))
error->all(FLERR,"Pair_modify special setting for pair hybrid "
"incompatible with global special_bonds setting");
"incompatible with global special_bonds setting");
}
}
}
@ -832,6 +832,12 @@ void PairHybrid::modify_params(int narg, char **arg)
Pair::modify_params(narg,arg);
for (int m = 0; m < nstyles; m++) styles[m]->modify_params(narg,arg);
}
// reset global compute_flag since there may have been changes
// to any of the substyles
compute_flag = 0;
for (int m = 0; m < nstyles; m++)
if (styles[m]->compute_flag) compute_flag = 1;
}
/* ----------------------------------------------------------------------