Merge pull request #1206 from akohlmey/collected-small-changes

Collected small changes for next release
This commit is contained in:
Axel Kohlmeyer 2018-11-15 17:29:26 -05:00 committed by GitHub
commit e4dee3de17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 283 additions and 140 deletions

View File

@ -304,7 +304,7 @@ pkg_depends(USER-SCAFACOS MPI)
find_package(OpenMP QUIET)
option(BUILD_OMP "Build with OpenMP support" ${OpenMP_FOUND})
if(BUILD_OMP OR PKG_USER-OMP OR PKG_KOKKOS OR PKG_USER-INTEL)
if(BUILD_OMP OR PKG_KOKKOS OR PKG_USER-INTEL)
find_package(OpenMP REQUIRED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

View File

@ -0,0 +1,184 @@
# Outline of the GitHub Development Workflow
This purpose of this document is to provide a point of reference for the
core LAMMPS developers and other LAMMPS contibutors to understand the
choices the LAMMPS developers have agreed on. Git and GitHub provide the
tools, but do not set policies, so it is up to the developers to come to
an agreement as to how to define and interpret policies. This document
is likely to change as our experiences and needs change and we try to
adapt accordingly. Last change 2018-11-15.
## Table of Contents
* [GitHub Merge Management](#github-merge-management)
* [Pull Requests](#pull-requests)
* [Pull Request Assignments](#pull-request-assignments)
* [Pull Request Reviews](#pull-request-reviews)
* [Pull Request Discussions](#pull-request-discussions)
* [Checklist for Pull Requests](#checklist-for-pull-requests)
* [GitHub Issues](#github-issues)
* [Milestones and Release Planning](#milestones-and-release-planning)
## GitHub Merge Management
In the interest of consistency, ONLY ONE of the core LAMMPS developers
should doing the merging itself. This is currently
[@akohlmey](https://github.com/akohlmey) (Axel Kohlmeyer).
If this assignment needs to be changed, it shall be done right after a
stable release.
## Pull Requests
ALL changes to the LAMMPS code and documentation, however trivial, MUST
be submitted as a pull request to GitHub. All changes to the "master"
branch must be made exclusively through merging pull requests. The
"unstable" and "stable" branches, respectively are only to be updated
upon patch or stable releases with fast-forward merges based on the
associated tags. Pull requests may also be submitted to (long-running)
feature branches created by LAMMPS developers inside the LAMMPS project,
if needed. Those are not subject to the merge and review restrictions
discussed in this document, though, but get manages as needed on a
case-by-case basis.
### Pull Request Assignments
Pull requests can be "chaperoned" by one of the LAMMPS core developers.
This is indicated by who the pull request is assigned to. LAMMPS core
developers can self-assign or they can decide to assign a pull request
to a different LAMMPS developer. Being assigned to a pull request means,
that this pull request may need some work and the assignee is tasked to
determine what this might be needed or not, and may either implement the
required changes or ask the submitter of the pull request to implement
them. Even though, all LAMMPS developers may have write access to pull
requests (if enabled by the submitter, which is the default), only the
submitter or the assignee of a pull request may do so. During this
period the "work_in_progress" label shall be applied to the pull
request. The assignee gets to decide what happens to the pull request
next, e.g. whether it should be assigned to a different developer for
additional checks and changes, or is recommended to be merged. Removing
the "work_in_progress" label and assigning the pull request to the
developer tasked with merging signals that a pull request is ready to be
merged.
### Pull Request Reviews
People can be assigned to review a pull request in two ways:
* They can be assigned manually to review a pull request
by the submitter or a LAMMPS developer
* They can be automatically assigned, because a developers matches
a file pattern in the `.github/CODEOWNERS` file, which associates
developers with the code they contributed and maintain.
Reviewers are requested to state their appraisal of the proposed changes
and either approve or request changes. People may unassign themselves
from review, if they feel not competent about the changes proposed. At
least one review from a LAMMPS developer with write access is required
before merging in addition to the automated compilation tests. The
feature, that reviews from code owners are "hard" reviews (i.e. they
must all be approved before merging is allowed), is currently disabled
and it is in the discretion of the merge maintainer to assess when
a sufficient degree of approval has been reached. Reviews may be
(automatically) dismissed, when the reviewed code has been changed,
and then approval is required a second time.
### Pull Request Discussions
All discussions about a pull request should be kept as much as possible
on the pull request discussion page on GitHub, so that other developers
can later review the entire discussion after the fact and understand the
rationale behind choices made. Exceptions to this policy are technical
discussions, that are centered on tools or policies themselves
(git, github, c++) rather than on the content of the pull request.
### Checklist for Pull Requests
Here are some items to check:
* source and text files should not have CR/LF line endings (use dos2unix to remove)
* every new command or style should have documentation. The names of
source files (c++ and manual) should follow the name of the style.
(example: `src/fix_nve.cpp`, `src/fix_nve.h` for `fix nve` command,
implementing the class `FixNVE`, documented in `doc/src/fix_nve.txt`)
* all new style names should be lower case, the must be no dashes,
blanks, or underscores separating words, only forward slashes.
* new style docs should be added to the "overview" files in
`doc/src/Commands_*.txt`, `doc/src/{fixes,computes,pairs,bonds,...}.txt`
and `doc/src/lammps.book`
* new files in packages should be added to `src/.gitignore`
* removed or renamed files in packages should be added to `src/Purge.list`
* C++ source files should use C++ style include files for accessing
C-library APIs, e.g. `#include <cstdlib>` instead of `#include <stdlib.h>`.
And they should use angular brackets instead of double quotes. Full list:
* assert.h -> cassert
* ctype.h -> cctype
* errno.h -> cerrno
* float.h -> cfloat
* limits.h -> climits
* math.h -> cmath
* omplex.h -> complex
* setjmp.h -> csetjmp
* signal.h -> csignal
* stddef.h -> cstddef
* stdint.h -> cstdint
* stdio.h -> cstdio
* stdlib.h -> cstdlib
* string.h -> cstring
* time.h -> ctime
Do not replace (as they are C++-11): `inttypes.h` and `stdint.h`.
* Code should follow the C++-98 standard. C++-11 is only accepted
in individual special purpose packages
* indentation is two spaces per level
* there should be no tabs and no trailing whitespace
* header files, especially of new styles, should not include any
other headers, except the header with the base class or cstdio.
Forward declarations should be used instead when possible.
* iostreams should be avoided. LAMMPS uses stdio from the C-library.
* use of STL in headers and class definitions should be avoided.
* static class members should be avoided at all cost.
* anything storing atom IDs should be using `tagint` and not `int`.
This can be flagged by the compiler only for pointers and only when
compiling LAMMPS with `-DLAMMPS_BIGBIG`.
* when including both `lmptype.h` (and using defines or macros from it)
and `mpi.h`, `lmptype.h` must be included first.
## GitHub Issues
The GitHub issue tracker is the location where the LAMMPS developers
and other contributors or LAMMPS users can report issues or bugs with
the LAMMPS code or request new features to be added. Feature requests
are usually indicated by a `[Feature Request]` marker in the subject.
Issues are assigned to a person, if this person is working on this
feature or working to resolve an issue. Issues that have nobody working
on them at the moment, have the label `volunteer needed` attached.
When an issue, say `#125` is resolved by a specific pull request,
the comment for the pull request shall contain the text `closes #125`
or `fixes #125`, so that the issue is automatically deleted when
the pull request is merged.
## Milestones and Release Planning
LAMMPS uses a continuous release development model with incremental
changes, i.e. significant effort is made - including automated pre-merge
testing - that the code in the branch "master" does not get broken.
More extensive testing (including regression testing) is performed after
code is merged to the "master" branch. There are patch releases of
LAMMPS every 1-3 weeks at a point, when the LAMMPS developers feel, that
a sufficient amount of changes have happened, and the post-merge testing
has been successful. These patch releases are marked with a
`patch_<version date>` tag and the "unstable" branch follows only these
versions (and thus is always supposed to be of production quality,
unlike "master", which may be temporary broken, in the case of larger
change sets or unexpected incompatibilities or side effects.
About 3-4 times each year, there are going to be "stable" releases
of LAMMPS. These have seen additional, manual testing and review of
results from testing with instrumented code and static code analysis.
Also, in the last 2-3 patch releases before a stable release are
"release candidate" versions which only contain bugfixes and
documentation updates. For release planning and the information of
code contributors, issues and pull requests being actively worked on
are assigned a "milestone", which corresponds to the next stable
release or the stable release after that, with a tentative release
date.

View File

@ -107,7 +107,7 @@ void PairBodyRoundedPolygon::compute(int eflag, int vflag)
int nei,nej,iefirst,jefirst;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl;
double rsq,rsqinv,r,radi,radj,eradi,eradj,rradi,rradj,k_nij,k_naij;
double xi[3],xj[3],facc[3];
double facc[3];
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;

View File

@ -274,14 +274,6 @@ double PairNMCut::init_one(int i, int j)
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rr1 = mm[i][j]*(nn[i][j]-1)*pow(r0[i][j],nn[i][j]);
double rr2 = nn[i][j]*(mm[i][j]-1)*pow(r0[i][j],mm[i][j]);
double p1 = 1-nn[i][j];
double p2 = 1-mm[i][j];
double rrr1 = pow(r0[i][j],nn[i][j])*(1-nn[i][j]);
double rrr2 = pow(r0[i][j],mm[i][j])*(1-mm[i][j]);
double cut3 = cut[i][j]*cut[i][j]*cut[i][j];
ptail_ij = 2.*MY_PI/3.*all[0]*all[1]*e0nm[i][j]*nm[i][j]*cut3 *
(pow(r0[i][j]/cut[i][j],nn[i][j])/(nn[i][j]-3) - pow(r0[i][j]/cut[i][j],mm[i][j])/(mm[i][j]-3));

View File

@ -324,14 +324,6 @@ double PairNMCutCoulCut::init_one(int i, int j)
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rr1 = mm[i][j]*(nn[i][j]-1)*pow(r0[i][j],nn[i][j]);
double rr2 = nn[i][j]*(mm[i][j]-1)*pow(r0[i][j],mm[i][j]);
double p1 = 1-nn[i][j];
double p2 = 1-mm[i][j];
double rrr1 = pow(r0[i][j],nn[i][j])*(1-nn[i][j]);
double rrr2 = pow(r0[i][j],mm[i][j])*(1-mm[i][j]);
double cut_lj3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
ptail_ij = 2.*MY_PI/3.*all[0]*all[1]*e0nm[i][j]*nm[i][j]*cut_lj3 *
(pow(r0[i][j]/cut_lj[i][j],nn[i][j])/(nn[i][j]-3) - pow(r0[i][j]/cut_lj[i][j],mm[i][j])/(mm[i][j]-3));

View File

@ -371,14 +371,6 @@ double PairNMCutCoulLong::init_one(int i, int j)
}
MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
double rr1 = mm[i][j]*(nn[i][j]-1)*pow(r0[i][j],nn[i][j]);
double rr2 = nn[i][j]*(mm[i][j]-1)*pow(r0[i][j],mm[i][j]);
double p1 = 1-nn[i][j];
double p2 = 1-mm[i][j];
double rrr1 = pow(r0[i][j],nn[i][j])*(1-nn[i][j]);
double rrr2 = pow(r0[i][j],mm[i][j])*(1-mm[i][j]);
double cut_lj3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
ptail_ij = 2.*MY_PI/3.*all[0]*all[1]*e0nm[i][j]*nm[i][j]*cut_lj3 *
(pow(r0[i][j]/cut_lj[i][j],nn[i][j])/(nn[i][j]-3) - pow(r0[i][j]/cut_lj[i][j],mm[i][j])/(mm[i][j]-3));

View File

@ -677,33 +677,33 @@ int AtomVecMolecular::unpack_exchange(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_angle[nlocal]; k++) {
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_dihedral[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_dihedral[nlocal]; k++) {
dihedral_type[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
dihedral_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
dihedral_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
dihedral_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_improper[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_improper[nlocal]; k++) {
improper_type[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
improper_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
improper_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
improper_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
@ -840,33 +840,33 @@ int AtomVecMolecular::unpack_restart(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_angle[nlocal]; k++) {
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_dihedral[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_dihedral[nlocal]; k++) {
dihedral_type[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
dihedral_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
dihedral_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
dihedral_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
dihedral_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_improper[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_improper[nlocal]; k++) {
improper_type[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
improper_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
improper_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
improper_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
improper_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;

View File

@ -943,7 +943,7 @@ double FixCMAP::dihedral_angle_atan2(double fx, double fy, double fz,
{
// calculate the dihedral angle
double angle, arg1, arg2;
double angle = 0.0, arg1, arg2;
arg1 = absg*(fx*bx+fy*by+fz*bz);
arg2 = ax*bx+ay*by+az*bz;

View File

@ -748,19 +748,9 @@ void FixPOEMS::initial_integrate(int vflag)
/* ---------------------------------------------------------------------- */
void FixPOEMS::post_force(int vflag)
void FixPOEMS::post_force(int /* vflag */)
{
if (earlyflag) compute_forces_and_torques();
/*
for (int ibody = 0; ibody < nbody; ibody++) {
if (ibody == 0) {
printf("PFF %d %g %g %g\n",ibody,fcm[ibody][0],fcm[ibody][1],fcm[ibody][2]);
printf("PFT %d %g %g %g\n",ibody,
torque[ibody][0],torque[ibody][1],torque[ibody][2]);
}
}
*/
}
/* ----------------------------------------------------------------------
@ -850,7 +840,7 @@ void FixPOEMS::final_integrate()
/* ---------------------------------------------------------------------- */
void FixPOEMS::initial_integrate_respa(int vflag, int ilevel, int iloop)
void FixPOEMS::initial_integrate_respa(int vflag, int ilevel, int /* iloop */)
{
dtv = step_respa[ilevel];
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
@ -862,14 +852,14 @@ void FixPOEMS::initial_integrate_respa(int vflag, int ilevel, int iloop)
/* ---------------------------------------------------------------------- */
void FixPOEMS::post_force_respa(int vflag, int ilevel, int iloop)
void FixPOEMS::post_force_respa(int vflag, int ilevel, int /* iloop */)
{
if (ilevel == nlevels_respa-1) post_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixPOEMS::final_integrate_respa(int ilevel, int iloop)
void FixPOEMS::final_integrate_respa(int ilevel, int /* iloop */)
{
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
final_integrate();
@ -949,7 +939,7 @@ int FixPOEMS::dof(int igroup)
thus this routine does nothing for now
------------------------------------------------------------------------- */
void FixPOEMS::deform(int flag) {}
void FixPOEMS::deform(int /* flag */) {}
/* ---------------------------------------------------------------------- */
@ -1607,7 +1597,7 @@ void FixPOEMS::grow_arrays(int nmax)
copy values within local atom-based arrays
------------------------------------------------------------------------- */
void FixPOEMS::copy_arrays(int i, int j, int delflag)
void FixPOEMS::copy_arrays(int i, int j, int /* delflag */)
{
natom2body[j] = natom2body[i];
for (int k = 0; k < natom2body[j]; k++) atom2body[j][k] = atom2body[i][k];

View File

@ -716,7 +716,7 @@ void FixHyperLocal::pre_reverse(int /* eflag */, int /* vflag */)
if (update->ntimestep % histo_print == 0) {
MPI_Allreduce(histo,allhisto,histo_count+2,MPI_LMP_BIGINT,MPI_SUM,world);
bigint total;
bigint total = 0;
for (i = 0; i < histo_count+2; i++) total += allhisto[i];
if (me == 0) {

View File

@ -87,7 +87,7 @@ class FixHyperLocal : public FixHyper {
int nevent; // # of events that trigger bond rebuild
int nevent_atom; // # of atoms that experienced an event
double cutbondsq,dcutsq;
double beta,t_hyper,invqfactorsq;
double beta,invqfactorsq;
double mybias;
double maxbondlen; // cummulative max length of any bond
double maxdriftsq; // max distance any atom drifts from original pos
@ -147,7 +147,7 @@ class FixHyperLocal : public FixHyper {
// histogramming of bond boost cooeficients
int histo_flag,histo_every,histo_count,histo_print,histo_steps;
int histo_every,histo_count,histo_print,histo_steps;
double histo_delta,invhisto_delta,histo_lo;
bigint *histo,*allhisto;
};

View File

@ -323,7 +323,7 @@ void PairSpinExchange::compute_single_pair(int ii, double fmi[3])
double **x = atom->x;
double **sp = atom->sp;
double local_cut2;
double xi[3], rij[3];
double xi[3];
double delx,dely,delz;
double spj[3];

View File

@ -103,9 +103,9 @@ PairOxdna2Coaxstk::~PairOxdna2Coaxstk()
void PairOxdna2Coaxstk::compute(int eflag, int vflag)
{
double delf[3],delt[3],delta[3],deltb[3]; // force, torque increment;
double delf[3],delta[3],deltb[3]; // force, torque increment;
double evdwl,fpair,finc,tpair,factor_lj;
double v1tmp[3],v2tmp[3],v3tmp[3];
double v1tmp[3];
double delr_ss[3],delr_ss_norm[3],rsq_ss,r_ss,rinv_ss;
double delr_st[3],delr_st_norm[3],rsq_st,r_st,rinv_st;
double theta1,theta1p,t1dir[3],cost1;
@ -114,12 +114,6 @@ void PairOxdna2Coaxstk::compute(int eflag, int vflag)
double theta6,theta6p,t6dir[3],cost6;
double cosphi3;
double gamma,gammacub,rinv_ss_cub,fac;
double aybx,azbx,rax,ray,raz,rbx;
double dcdr,dcdrbx;
double dcdaxbx,dcdaybx,dcdazbx;
double dcdrax,dcdray,dcdraz;
// distances COM-backbone site, COM-stacking site
double d_cs=-0.4, d_cst=+0.34;
// vectors COM-backbone site, COM-stacking site in lab frame

View File

@ -50,7 +50,7 @@ static int cmptagint(const void *p1, const void *p2)
static void write_group(FILE *fp, int gid, Atom *atom, Group *group, int me,
int np, MPI_Comm world, FILE *screen, FILE *logfile)
{
char fmt[8];
char fmt[16];
tagint *sendlist, *recvlist;
bigint num = group->count(gid);
int lnum, cols;
@ -73,7 +73,7 @@ static void write_group(FILE *fp, int gid, Atom *atom, Group *group, int me,
++i;
j /= 10;
}
sprintf(fmt,"%%%dd ", i);
snprintf(fmt,16,"%%%dd ", i);
cols = 80 / (i+1);
}

View File

@ -758,8 +758,10 @@ void FixRX::pre_force(int /*vflag*/)
memory->create( diagnosticCounterPerODE[FuncSum], nlocal, "FixRX::diagnosticCounterPerODE");
}
//#pragma omp parallel \
// reduction(+: nSteps, nIters, nFuncs, nFails )
#if 0
#pragma omp parallel \
reduction(+: nSteps, nIters, nFuncs, nFails )
#endif
{
double *rwork = new double[8*nspecies];

View File

@ -210,7 +210,7 @@ void ComputeStressMop::init()
/* ---------------------------------------------------------------------- */
void ComputeStressMop::init_list(int id, NeighList *ptr)
void ComputeStressMop::init_list(int /* id */, NeighList *ptr)
{
list = ptr;
}
@ -246,9 +246,9 @@ void ComputeStressMop::compute_vector()
void ComputeStressMop::compute_pairs()
{
int i,j,m,n,ii,jj,inum,jnum,itype,jtype;
int i,j,m,ii,jj,inum,jnum,itype,jtype;
double delx,dely,delz;
double rsq,eng,fpair,factor_coul,factor_lj;
double rsq,fpair,factor_coul,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
double *mass = atom->mass;
@ -363,8 +363,7 @@ void ComputeStressMop::compute_pairs()
// counts local particles transfers across the plane
if (which[m] == KIN || which[m] == TOTAL){
double vcm[3];
double masstotal,sgn;
double sgn;
for (int i = 0; i < nlocal; i++){

View File

@ -211,7 +211,7 @@ void ComputeStressMopProfile::init()
/* ---------------------------------------------------------------------- */
void ComputeStressMopProfile::init_list(int id, NeighList *ptr)
void ComputeStressMopProfile::init_list(int /* id */, NeighList *ptr)
{
list = ptr;
}
@ -253,11 +253,11 @@ void ComputeStressMopProfile::compute_array()
void ComputeStressMopProfile::compute_pairs()
{
int i,j,m,n,ii,jj,inum,jnum,itype,jtype,ibin;
int i,j,m,ii,jj,inum,jnum,itype,jtype,ibin;
double delx,dely,delz;
double rsq,eng,fpair,factor_coul,factor_lj;
double rsq,fpair,factor_coul,factor_lj;
int *ilist,*jlist,*numneigh,**firstneigh;
double pos,pos1,pos_temp;
double pos,pos1;
double *mass = atom->mass;
int *type = atom->type;
@ -385,8 +385,7 @@ void ComputeStressMopProfile::compute_pairs()
if (which[m] == KIN || which[m] == TOTAL){
double vcm[3];
double masstotal,sgn;
double sgn;
for (int i = 0; i < nlocal; i++){
@ -449,13 +448,12 @@ void ComputeStressMopProfile::compute_pairs()
void ComputeStressMopProfile::setup_bins()
{
int i,j,k,m,n;
double lo,hi,coord1,coord2;
int i,n;
double lo = 0.0, hi = 0.0;
double *boxlo,*boxhi,*prd;
double *boxlo,*boxhi;
boxlo = domain->boxlo;
boxhi = domain->boxhi;
prd = domain->prd;
if (originflag == LOWER) origin = boxlo[dir];
else if (originflag == UPPER) origin = boxhi[dir];

View File

@ -50,7 +50,6 @@ namespace LAMMPS_NS {
double **coord,**coordp;
double **values_local,**values_global;
int ndim;
double dt,nktv2p,ftm2v;
double area;
class NeighList *list;

View File

@ -108,8 +108,6 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) :
}
t_target=t_start;
const double kT = t_target * force->boltz / force->mvv2e;
// initialize Marsaglia RNG with processor-unique seed
// NB: this means runs will not be the same with different numbers of processors
@ -298,7 +296,7 @@ void FixFFL::ffl_integrate() {
}
void FixFFL::initial_integrate(int vflag) {
void FixFFL::initial_integrate(int /* vflag */) {
double dtfm;
// update v and x of atoms in group
@ -391,7 +389,7 @@ void FixFFL::final_integrate() {
}
/* ---------------------------------------------------------------------- */
void FixFFL::initial_integrate_respa(int vflag, int ilevel, int iloop) {
void FixFFL::initial_integrate_respa(int vflag, int ilevel, int /* iloop */) {
dtv = step_respa[ilevel];
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
@ -406,7 +404,7 @@ void FixFFL::initial_integrate_respa(int vflag, int ilevel, int iloop) {
}
}
void FixFFL::final_integrate_respa(int ilevel, int iloop) {
void FixFFL::final_integrate_respa(int ilevel, int /* iloop */) {
dtv = step_respa[ilevel];
dtf = 0.5 * step_respa[ilevel] * force->ftm2v;

View File

@ -592,14 +592,13 @@ void FixFilterCorotate::pre_neighbor()
double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]);
int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2]));
if (fabs(signum)!= 1)
if (abs(signum) != 1)
error->all(FLERR,"Wrong orientation in cluster of size 4"
"in fix filter/corotate!");
clist_q0[i][8] *= signum;
clist_q0[i][11] *= signum;
} else if (N == 5)
{
} else if (N == 5) {
oxy = atom->map(shake_atom[m][0]);
atom1 = atom->map(shake_atom[m][1]);
atom2 = atom->map(shake_atom[m][2]);
@ -666,14 +665,12 @@ void FixFilterCorotate::pre_neighbor()
double c = (del2[0])*(del3[1]) - (del2[1])*(del3[0]);
int signum = sgn(a*(del1[0]) + b*(del1[1]) + c*(del1[2]));
if (fabs(signum)!= 1)
if (abs(signum)!= 1)
error->all(FLERR,"Wrong orientation in cluster of size 5"
"in fix filter/corotate!");
clist_q0[i][8] *= signum;
clist_q0[i][11] *= signum;
}
else
{
} else {
error->all(FLERR,"Fix filter/corotate cluster with size > 5"
"not yet configured...");
}

View File

@ -429,7 +429,7 @@ void AngleClass2P6::read_restart(FILE *fp)
void AngleClass2P6::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++)
fprintf(fp,"%d %g %g %g %g\n",
fprintf(fp,"%d %g %g %g %g %g %g\n",
i,theta0[i]/MY_PI*180.0,k2[i],k3[i],k4[i],k5[i],k6[i]);
fprintf(fp,"\nBondBond Coeffs\n\n");

View File

@ -353,7 +353,7 @@ void AngleCosineBuck6d::read_restart(FILE *fp)
void AngleCosineBuck6d::write_data(FILE *fp)
{
for (int i = 1; i <= atom->nangletypes; i++) {
fprintf(fp,"%d %g %d %d\n",i,k[i],multiplicity[i],th0[i]);
fprintf(fp,"%d %g %d %g\n",i,k[i],multiplicity[i],th0[i]);
}
}

View File

@ -241,8 +241,8 @@ void ImproperInversionHarmonic::invang(const int &i1,const int &i2,
f[i4][2] += f4[2];
}
double rb3x, rb3y, rb3z;
if (evflag)
if (evflag) {
double rb3x, rb3y, rb3z;
rb3x = vb1x - vb2x;
rb3y = vb1y - vb2y;
@ -252,6 +252,7 @@ void ImproperInversionHarmonic::invang(const int &i1,const int &i2,
vb3x,vb3y,vb3z,
vb2x,vb2y,vb2z,
rb3x,rb3y,rb3z);
}
}
/* ---------------------------------------------------------------------- */

View File

@ -83,7 +83,7 @@ void PairBuck6dCoulGaussDSF::compute(int eflag, int vflag)
double r,rsq,r2inv,r6inv,r14inv,rexp,forcecoul,forcebuck6d,factor_coul,factor_lj;
double term1,term2,term3,term4,term5;
double rcu,rqu,sme,smf,ebuck6d;
double prefactor,erfcc,erfcd,t,arg;
double prefactor,erfcc,erfcd,arg;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = ecoul = 0.0;

View File

@ -85,7 +85,7 @@ void PairBuck6dCoulGaussLong::compute(int eflag, int vflag)
double grij,expm2,erf;
double term1,term2,term3,term4,term5;
double rcu,rqu,sme,smf,ebuck6d,ealpha;
double prefactor,erfa,expa,t,arg,falpha;
double prefactor,erfa,expa,arg,falpha;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = ecoul = 0.0;

View File

@ -80,7 +80,9 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg)
if (nthreads < 1)
error->all(FLERR,"Illegal number of OpenMP threads requested");
#if defined(_OPENMP)
int reset_thr = 0;
#endif
if (nthreads != comm->nthreads) {
#if defined(_OPENMP)
reset_thr = 1;

View File

@ -185,6 +185,7 @@ static inline void loop_setup_thr(int &ifrom, int &ito, int &tid,
tid = 0;
ifrom = 0;
ito = inum;
nthreads = 1;
#endif
}

View File

@ -66,7 +66,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
// chunk style and its args
int iarg;
int iarg = 0;
binflag = 0;
ncoord = 0;
@ -248,7 +248,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
iarg += 2;
} else if (strcmp(arg[iarg],"bound") == 0) {
if (iarg+4 > narg) error->all(FLERR,"Illegal compute chunk/atom command");
int idim;
int idim = 0;
if (strcmp(arg[iarg+1],"x") == 0) idim = 0;
else if (strcmp(arg[iarg+1],"y") == 0) idim = 1;
else if (strcmp(arg[iarg+1],"z") == 0) idim = 2;

View File

@ -33,7 +33,7 @@ class ComputeDihedralLocal : public Compute {
double memory_usage();
private:
int nvalues,nvar,ncount,setflag,tflag;
int nvalues,nvar,ncount,setflag;
int pvar;
int *bstyle,*vvar;

View File

@ -54,7 +54,7 @@ void CreateBonds::command(int narg, char **arg)
int style;
int iarg;
int iarg = 0;
if (strcmp(arg[0],"many") == 0) {
style = MANY;
if (narg != 6) error->all(FLERR,"Illegal create_bonds command");

View File

@ -118,7 +118,7 @@ void DisplaceAtoms::command(int narg, char **arg)
if (style == RAMP) {
int d_dim;
int d_dim = 0;
if (strcmp(arg[2],"x") == 0) d_dim = 0;
else if (strcmp(arg[2],"y") == 0) d_dim = 1;
else if (strcmp(arg[2],"z") == 0) d_dim = 2;
@ -136,7 +136,7 @@ void DisplaceAtoms::command(int narg, char **arg)
d_hi = zscale*force->numeric(FLERR,arg[4]);
}
int coord_dim;
int coord_dim = 0;
if (strcmp(arg[5],"x") == 0) coord_dim = 0;
else if (strcmp(arg[5],"y") == 0) coord_dim = 1;
else if (strcmp(arg[5],"z") == 0) coord_dim = 2;

View File

@ -1290,7 +1290,7 @@ int DumpImage::modify_param(int narg, char **arg)
if (strcmp(arg[0],"amap") == 0) {
if (narg < 6) error->all(FLERR,"Illegal dump_modify command");
if (strlen(arg[3]) != 2) error->all(FLERR,"Illegal dump_modify command");
int factor;
int factor = 0;
if (arg[3][0] == 's') factor = 1;
else if (arg[3][0] == 'c') factor = 2;
else if (arg[3][0] == 'd') factor = 3;

View File

@ -802,7 +802,7 @@ void FixDeform::end_of_step()
// tilt_target can be large positive or large negative value
// add/subtract box lengths until tilt_target is closest to current value
int idenom;
int idenom = 0;
if (i == 5) idenom = 0;
else if (i == 4) idenom = 0;
else if (i == 3) idenom = 1;

View File

@ -68,7 +68,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
// parse args
int iarg;
int iarg = 0;
if (strcmp(arg[3],"linear") == 0) {
if (narg < 7) error->all(FLERR,"Illegal fix move command");

View File

@ -1138,7 +1138,7 @@ void Input::partition()
{
if (narg < 3) error->all(FLERR,"Illegal partition command");
int yesflag;
int yesflag = 0;
if (strcmp(arg[0],"yes") == 0) yesflag = 1;
else if (strcmp(arg[0],"no") == 0) yesflag = 0;
else error->all(FLERR,"Illegal partition command");

View File

@ -1248,7 +1248,7 @@ void ReadData::bonds(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process bonds
@ -1331,7 +1331,7 @@ void ReadData::angles(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process angles
@ -1414,7 +1414,7 @@ void ReadData::dihedrals(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process dihedrals
@ -1435,7 +1435,7 @@ void ReadData::dihedrals(int firstpass)
if (firstpass) {
int max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,count[i]);
for (int i = nlocal_previous; i < nlocal; i++) max = MAX(max,count[i]);
int maxall;
MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
if (addflag == NONE) maxall += atom->extra_dihedral_per_atom;
@ -1497,7 +1497,7 @@ void ReadData::impropers(int firstpass)
int *count = NULL;
if (firstpass) {
memory->create(count,nlocal,"read_data:count");
for (int i = 0; i < nlocal; i++) count[i] = 0;
memset(count,0,nlocal*sizeof(int));
}
// read and process impropers

View File

@ -924,11 +924,13 @@ void ReadRestart::header(int incompatible)
atom->extra_dihedral_per_atom = read_int();
} else if (flag == EXTRA_IMPROPER_PER_ATOM) {
atom->extra_improper_per_atom = read_int();
} else if (flag == EXTRA_SPECIAL_PER_ATOM) {
force->special_extra = read_int();
} else if (flag == ATOM_MAXSPECIAL) {
atom->maxspecial = read_int();
// for backward compatibility
} else if (flag == EXTRA_SPECIAL_PER_ATOM) {
force->special_extra = read_int();
} else error->all(FLERR,"Invalid flag in header section of restart file");
flag = read_int();

View File

@ -890,7 +890,7 @@ void Set::set(int keyword)
// enforce quat rotation vector in z dir for 2d systems
else if (keyword == QUAT) {
double *quat;
double *quat = NULL;
if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
else if (avec_tri && atom->tri[i] >= 0)

View File

@ -182,7 +182,7 @@ void Variable::set(int narg, char **arg)
if (find(arg[0]) >= 0) return;
if (nvar == maxvar) grow();
style[nvar] = LOOP;
int nfirst,nlast;
int nfirst = 0,nlast = 0;
if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) {
nfirst = 1;
nlast = force->inumeric(FLERR,arg[2]);
@ -3983,7 +3983,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
strcmp(word,"max") == 0 || strcmp(word,"ave") == 0 ||
strcmp(word,"trap") == 0 || strcmp(word,"slope") == 0) {
int method;
int method = 0;
if (strcmp(word,"sum") == 0) method = SUM;
else if (strcmp(word,"min") == 0) method = XMIN;
else if (strcmp(word,"max") == 0) method = XMAX;

View File

@ -641,7 +641,7 @@ void Velocity::ramp(int /*narg*/, char **arg)
// parse args
int v_dim;
int v_dim = 0;
if (strcmp(arg[0],"vx") == 0) v_dim = 0;
else if (strcmp(arg[0],"vy") == 0) v_dim = 1;
else if (strcmp(arg[0],"vz") == 0) v_dim = 2;
@ -662,7 +662,7 @@ void Velocity::ramp(int /*narg*/, char **arg)
v_hi = zscale*force->numeric(FLERR,arg[2]);
}
int coord_dim;
int coord_dim = 0;
if (strcmp(arg[3],"x") == 0) coord_dim = 0;
else if (strcmp(arg[3],"y") == 0) coord_dim = 1;
else if (strcmp(arg[3],"z") == 0) coord_dim = 2;

View File

@ -45,7 +45,7 @@ void WriteDump::command(int narg, char **arg)
// create the Dump instance
// create dump command line with extra required args
Dump *dump;
Dump *dump = NULL;
char **dumpargs = new char*[modindex+2];
dumpargs[0] = (char *) "WRITE_DUMP"; // dump id