git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14895 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2016-04-27 14:56:23 +00:00
parent 05d35188c7
commit 5f86c15dd2
5 changed files with 23 additions and 12 deletions

View File

@ -287,11 +287,10 @@ class Actions:
else: wrapper = cc.wrap else: wrapper = cc.wrap
abbrev = cc.abbrev abbrev = cc.abbrev
if abbrev == "mpi": if abbrev == "mpi":
txt = commands.getoutput("mpicxx -show") if cc.parent == "mpich":
if "-lmpich" in txt:
make.addvar("CC","-cxx=%s" % wrapper) make.addvar("CC","-cxx=%s" % wrapper)
make.addvar("LINK","-cxx=%s" % wrapper) make.addvar("LINK","-cxx=%s" % wrapper)
elif "-lmpi" in txt: elif cc.parent == "openmpi":
make.addvar("export OMPI_CXX",wrapper,"cc") make.addvar("export OMPI_CXX",wrapper,"cc")
precompiler = "env OMPI_CXX=%s " % wrapper precompiler = "env OMPI_CXX=%s " % wrapper
else: error("Could not add MPI wrapper compiler, " + else: error("Could not add MPI wrapper compiler, " +
@ -1716,10 +1715,11 @@ class Cc:
self.inlist = copy.copy(list) self.inlist = copy.copy(list)
self.compiler = self.abbrev = "" self.compiler = self.abbrev = ""
self.wrap = "" self.wrap = ""
self.parent = ""
def help(self): def help(self):
return """ return """
-cc compiler wrap=wcompiler -cc compiler wrap=wcompiler,parent
alter CC setting in Makefile.auto alter CC setting in Makefile.auto
only happens if new Makefile.auto is created by use of "file" action only happens if new Makefile.auto is created by use of "file" action
compiler is required, all other args are optional compiler is required, all other args are optional
@ -1729,6 +1729,8 @@ class Cc:
mpi by itself is changed to mpicxx mpi by itself is changed to mpicxx
wcompiler = compiler for mpi wrapper to use wcompiler = compiler for mpi wrapper to use
use nvcc for building for Kokkos/cuda with provided nvcc_wrapper use nvcc for building for Kokkos/cuda with provided nvcc_wrapper
parent = openmpi or mpich
parent style determines syntax for setting low-level compiler
""" """
def check(self): def check(self):
@ -1750,9 +1752,12 @@ class Cc:
for one in self.inlist[1:]: for one in self.inlist[1:]:
words = one.split('=') words = one.split('=')
if len(words) != 2: error("-cc args are invalid") if len(words) != 2: error("-cc args are invalid")
args = words[1].split(',')
if len(args) != 2: error("-cc args are invalid")
if words[0] == "wrap": if words[0] == "wrap":
if self.abbrev != "mpi": error("-cc compiler is not a wrapper") if self.abbrev != "mpi": error("-cc compiler is not a wrapper")
self.wrap = words[1] self.wrap = args[0]
self.parent = args[1]
else: error("-cc args are invalid") else: error("-cc args are invalid")
# Flags class # Flags class

View File

@ -102,8 +102,8 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg)
while (iarg < narg) { while (iarg < narg) {
if (strcmp(arg[iarg],"neigh") == 0) { if (strcmp(arg[iarg],"neigh") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal package omp command"); if (iarg+2 > narg) error->all(FLERR,"Illegal package omp command");
if (strcmp(arg[iarg]+1,"yes") == 0) _neighbor = true; if (strcmp(arg[iarg+1],"yes") == 0) _neighbor = true;
else if (strcmp(arg[iarg]+1,"no") == 0) _neighbor = false; else if (strcmp(arg[iarg+1],"no") == 0) _neighbor = false;
else error->all(FLERR,"Illegal package omp command"); else error->all(FLERR,"Illegal package omp command");
iarg += 2; iarg += 2;
} else error->all(FLERR,"Illegal package omp command"); } else error->all(FLERR,"Illegal package omp command");

View File

@ -284,10 +284,10 @@ void PairReaxC::coeff( int nargs, char **args )
fp = force->open_potential(file); fp = force->open_potential(file);
if (fp != NULL) if (fp != NULL)
Read_Force_Field(fp, &(system->reax_param), control); Read_Force_Field(fp, &(system->reax_param), control);
else if (comm->me == 0) { else {
char str[128]; char str[128];
sprintf(str,"Cannot open ReaxFF potential file %s",file); sprintf(str,"Cannot open ReaxFF potential file %s",file);
error->one(FLERR,str); error->all(FLERR,str);
} }
// read args that map atom types to elements in potential file // read args that map atom types to elements in potential file

View File

@ -41,6 +41,9 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) :
xflag = force->inumeric(FLERR,arg[3]); xflag = force->inumeric(FLERR,arg[3]);
yflag = force->inumeric(FLERR,arg[4]); yflag = force->inumeric(FLERR,arg[4]);
zflag = force->inumeric(FLERR,arg[5]); zflag = force->inumeric(FLERR,arg[5]);
if ((xflag != 0 && xflag != 1) || (yflag != 0 && yflag != 1)
|| (zflag != 0 && zflag != 1))
error->all(FLERR,"Illegal compute temp/partial command");
if (zflag && domain->dimension == 2) if (zflag && domain->dimension == 2)
error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx"); error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx");
@ -77,7 +80,10 @@ void ComputeTempPartial::dof_compute()
natoms_temp = group->count(igroup); natoms_temp = group->count(igroup);
int nper = xflag+yflag+zflag; int nper = xflag+yflag+zflag;
dof = nper * natoms_temp; dof = nper * natoms_temp;
dof -= (1.0*nper/domain->dimension)*fix_dof + extra_dof;
// distribute extra dofs evenly across active dimensions
dof -= (1.0*nper/domain->dimension)*(fix_dof + extra_dof);
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz); if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
else tfactor = 0.0; else tfactor = 0.0;
} }

View File

@ -718,11 +718,11 @@ void FixNH::setup(int vflag)
t_current = temperature->compute_scalar(); t_current = temperature->compute_scalar();
tdof = temperature->dof; tdof = temperature->dof;
// t_target is needed by NPH and NPT in compute_scalar() // t_target is needed by NVT and NPT in compute_scalar()
// If no thermostat or using fix nphug, // If no thermostat or using fix nphug,
// t_target must be defined by other means. // t_target must be defined by other means.
if (tstat_flag && strcmp(style,"nphug") != 0) { if (tstat_flag && strstr(style,"nphug") == NULL) {
compute_temp_target(); compute_temp_target();
} else if (pstat_flag) { } else if (pstat_flag) {