git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13746 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
47
src/Make.py
47
src/Make.py
@ -349,7 +349,6 @@ class Actions:
|
|||||||
if final["user-omp"]:
|
if final["user-omp"]:
|
||||||
if compile_check(compiler,pre + "-restrict",0):
|
if compile_check(compiler,pre + "-restrict",0):
|
||||||
make.addvar("CCFLAGS",pre + "-restrict")
|
make.addvar("CCFLAGS",pre + "-restrict")
|
||||||
#if "nvcc" not in compiler:
|
|
||||||
if compile_check(compiler,pre + "-fopenmp",1):
|
if compile_check(compiler,pre + "-fopenmp",1):
|
||||||
make.addvar("CCFLAGS",pre + "-fopenmp")
|
make.addvar("CCFLAGS",pre + "-fopenmp")
|
||||||
make.addvar("LINKFLAGS",pre + "-fopenmp")
|
make.addvar("LINKFLAGS",pre + "-fopenmp")
|
||||||
@ -400,23 +399,25 @@ class Actions:
|
|||||||
|
|
||||||
if final["kokkos"]:
|
if final["kokkos"]:
|
||||||
if kokkos.mode == "omp":
|
if kokkos.mode == "omp":
|
||||||
make.addvar("OMP","yes","lmp")
|
make.delvar("KOKKOS_DEVICES","*")
|
||||||
make.delvar("CUDA")
|
make.delvar("KOKKOS_ARCH","*")
|
||||||
make.delvar("MIC")
|
make.addvar("KOKKOS_DEVICES","OpenMP","lmp")
|
||||||
elif kokkos.mode == "cuda":
|
elif kokkos.mode == "cuda":
|
||||||
if "nvcc" not in compiler:
|
#if "nvcc" not in compiler:
|
||||||
error("Kokkos/cuda build appears to not be " +
|
# error("Kokkos/cuda build appears to not be " +
|
||||||
"using NVIDIA nvcc compiler",0)
|
# "using NVIDIA nvcc compiler",0)
|
||||||
make.addvar("OMP","yes","lmp")
|
make.delvar("KOKKOS_DEVICES","*")
|
||||||
make.addvar("CUDA","yes","lmp")
|
make.delvar("KOKKOS_ARCH","*")
|
||||||
make.delvar("MIC")
|
make.addvar("KOKKOS_DEVICES","Cuda, OpenMP","lmp")
|
||||||
if kokkos.archflag:
|
if kokkos.arch[0] == "3":
|
||||||
make.delvar("CCFLAGS","-arch=sm_*")
|
make.addvar("KOKKOS_ARCH","Kepler" + kokkos.arch,"lmp")
|
||||||
make.addvar("CCFLAGS","-arch=sm_%s" % kokkos.arch)
|
elif kokkos.arch[0] == "2":
|
||||||
|
make.addvar("KOKKOS_ARCH","Fermi" + kokkos.arch,"lmp")
|
||||||
elif kokkos.mode == "phi":
|
elif kokkos.mode == "phi":
|
||||||
make.addvar("OMP","yes","lmp")
|
make.delvar("KOKKOS_DEVICES","*")
|
||||||
make.addvar("MIC","yes","lmp")
|
make.delvar("KOKKOS_ARCH","*")
|
||||||
make.delvar("CUDA")
|
make.addvar("KOKKOS_DEVICES","OpenMP","lmp")
|
||||||
|
make.addvar("KOKKOS_ARCH","KNC","lmp")
|
||||||
|
|
||||||
# add LMP settings
|
# add LMP settings
|
||||||
|
|
||||||
@ -495,7 +496,6 @@ class Actions:
|
|||||||
if caller == "file" or "file" not in self.alist:
|
if caller == "file" or "file" not in self.alist:
|
||||||
make.write("%s/MAKE/MINE/Makefile.auto" % dir.src,1)
|
make.write("%s/MAKE/MINE/Makefile.auto" % dir.src,1)
|
||||||
print "Created src/MAKE/MINE/Makefile.auto"
|
print "Created src/MAKE/MINE/Makefile.auto"
|
||||||
|
|
||||||
|
|
||||||
# test full compile and link
|
# test full compile and link
|
||||||
# unless caller = "file" and "exe" action will be invoked later
|
# unless caller = "file" and "exe" action will be invoked later
|
||||||
@ -1466,15 +1466,16 @@ class Kokkos:
|
|||||||
def __init__(self,list):
|
def __init__(self,list):
|
||||||
if list == None: self.inlist = None
|
if list == None: self.inlist = None
|
||||||
else: self.inlist = list[:]
|
else: self.inlist = list[:]
|
||||||
self.mode = "omp"
|
self.mode = ""
|
||||||
self.archflag = 0
|
self.archflag = 0
|
||||||
|
|
||||||
def help(self):
|
def help(self):
|
||||||
return """
|
return """
|
||||||
-kokkos mode arch=N
|
-kokkos mode arch=N
|
||||||
mode is not optional, arch is optional
|
mode is not optional, arch is optional
|
||||||
mode = omp or cuda or phi (def = omp if -kokkos is not used)
|
mode = omp or cuda or phi (def = KOKKOS_DEVICES setting in Makefile )
|
||||||
build Kokkos package for omp or cuda or phi
|
build Kokkos package for omp or cuda or phi
|
||||||
|
set KOKKOS_DEVICES to "OpenMP" (omp, phi) or "Cuda, OpenMP" (cuda)
|
||||||
arch = 31 (Kepler) or 21 (Fermi) (def = -arch setting in Makefile)
|
arch = 31 (Kepler) or 21 (Fermi) (def = -arch setting in Makefile)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -1826,7 +1827,7 @@ class MakeReader:
|
|||||||
# add value to var
|
# add value to var
|
||||||
# do not add if value already defined by var
|
# do not add if value already defined by var
|
||||||
# if var not defined,
|
# if var not defined,
|
||||||
# create new variable using where
|
# create new variable using "where"
|
||||||
# where="cc", line before "CC =" line, use ":="
|
# where="cc", line before "CC =" line, use ":="
|
||||||
# where="lmp", 2 lines before "LAMMPS-specific settings" line, use "="
|
# where="lmp", 2 lines before "LAMMPS-specific settings" line, use "="
|
||||||
|
|
||||||
@ -1857,8 +1858,12 @@ class MakeReader:
|
|||||||
# if var or value not defined, ignore it
|
# if var or value not defined, ignore it
|
||||||
|
|
||||||
def delvar(self,var,value=None):
|
def delvar(self,var,value=None):
|
||||||
|
#if var == "KOKKOS_DEVICES":
|
||||||
|
# print self.var,value
|
||||||
if var not in self.var: return
|
if var not in self.var: return
|
||||||
if not value: del self.var[var]
|
if not value:
|
||||||
|
del self.var[var]
|
||||||
|
#print "AGAIN",self.var
|
||||||
elif value and value[-1] != '*':
|
elif value and value[-1] != '*':
|
||||||
if value not in self.var[var]: return
|
if value not in self.var[var]: return
|
||||||
self.var[var].remove(value)
|
self.var[var].remove(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user