From 5f86c15dd224a1affb857634e397ccca94d01e26 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 27 Apr 2016 14:56:23 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14895 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/Make.py | 15 ++++++++++----- src/USER-OMP/fix_omp.cpp | 4 ++-- src/USER-REAXC/pair_reax_c.cpp | 4 ++-- src/compute_temp_partial.cpp | 8 +++++++- src/fix_nh.cpp | 4 ++-- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/Make.py b/src/Make.py index 8e57c7491b..e42c703b8c 100755 --- a/src/Make.py +++ b/src/Make.py @@ -287,11 +287,10 @@ class Actions: else: wrapper = cc.wrap abbrev = cc.abbrev if abbrev == "mpi": - txt = commands.getoutput("mpicxx -show") - if "-lmpich" in txt: + if cc.parent == "mpich": make.addvar("CC","-cxx=%s" % wrapper) make.addvar("LINK","-cxx=%s" % wrapper) - elif "-lmpi" in txt: + elif cc.parent == "openmpi": make.addvar("export OMPI_CXX",wrapper,"cc") precompiler = "env OMPI_CXX=%s " % wrapper else: error("Could not add MPI wrapper compiler, " + @@ -1716,10 +1715,11 @@ class Cc: self.inlist = copy.copy(list) self.compiler = self.abbrev = "" self.wrap = "" + self.parent = "" def help(self): return """ --cc compiler wrap=wcompiler +-cc compiler wrap=wcompiler,parent alter CC setting in Makefile.auto only happens if new Makefile.auto is created by use of "file" action compiler is required, all other args are optional @@ -1729,6 +1729,8 @@ class Cc: mpi by itself is changed to mpicxx wcompiler = compiler for mpi wrapper to use 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): @@ -1750,9 +1752,12 @@ class Cc: for one in self.inlist[1:]: words = one.split('=') 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 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") # Flags class diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index 7cb63bcc16..cd90ef6e15 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -102,8 +102,8 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"neigh") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package omp command"); - if (strcmp(arg[iarg]+1,"yes") == 0) _neighbor = true; - else if (strcmp(arg[iarg]+1,"no") == 0) _neighbor = false; + if (strcmp(arg[iarg+1],"yes") == 0) _neighbor = true; + else if (strcmp(arg[iarg+1],"no") == 0) _neighbor = false; else error->all(FLERR,"Illegal package omp command"); iarg += 2; } else error->all(FLERR,"Illegal package omp command"); diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp index dc977249fc..352a9468b3 100644 --- a/src/USER-REAXC/pair_reax_c.cpp +++ b/src/USER-REAXC/pair_reax_c.cpp @@ -284,10 +284,10 @@ void PairReaxC::coeff( int nargs, char **args ) fp = force->open_potential(file); if (fp != NULL) Read_Force_Field(fp, &(system->reax_param), control); - else if (comm->me == 0) { + else { char str[128]; 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 diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index c4e8e7cd88..b330495c54 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -41,6 +41,9 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : xflag = force->inumeric(FLERR,arg[3]); yflag = force->inumeric(FLERR,arg[4]); 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) 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); int nper = xflag+yflag+zflag; 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); else tfactor = 0.0; } diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 89bd562e8e..b300fd2d46 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -718,11 +718,11 @@ void FixNH::setup(int vflag) t_current = temperature->compute_scalar(); 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, // 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(); } else if (pstat_flag) {