From 20a4e365b70041d51420d85d8ec2b7cdac6621b1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 6 Jan 2017 21:30:13 -0500 Subject: [PATCH 01/18] reduce warning when processing manual with sphinx --- doc/src/commands.txt | 1 + doc/src/computes.txt | 1 + doc/src/fix_grem.txt | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/src/commands.txt b/doc/src/commands.txt index c5f22c666f..2fdb69ea4d 100644 --- a/doc/src/commands.txt +++ b/doc/src/commands.txt @@ -91,6 +91,7 @@ Commands :h1 suffix tad temper + temper_grem thermo thermo_modify thermo_style diff --git a/doc/src/computes.txt b/doc/src/computes.txt index e7e54a6b3b..1d01798791 100644 --- a/doc/src/computes.txt +++ b/doc/src/computes.txt @@ -35,6 +35,7 @@ Computes :h1 compute_erotate_sphere_atom compute_event_displace compute_fep + compute_global_atom compute_group_group compute_gyration compute_gyration_chunk diff --git a/doc/src/fix_grem.txt b/doc/src/fix_grem.txt index eac4d6f4ba..3fc5c1a10e 100644 --- a/doc/src/fix_grem.txt +++ b/doc/src/fix_grem.txt @@ -29,7 +29,7 @@ fix fxgREM all grem 502 -0.15 -80000 fxnvt :pre [Description:] This fix implements the molecular dynamics version of the generalized -replica exchange method (gREM) originally developed by "(Kim)"_#Kim, +replica exchange method (gREM) originally developed by "(Kim)"_#Kim2010, which uses non-Boltzmann ensembles to sample over first order phase transitions. The is done by defining replicas with an enthalpy dependent effective temperature @@ -103,7 +103,7 @@ npt"_fix_nh.html, "thermo_modify"_thermo_modify.html :line -:link(Kim) +:link(Kim2010) [(Kim)] Kim, Keyes, Straub, J Chem. Phys, 132, 224107 (2010). :link(Malolepsza) From 51e52b477a51614fc24f85aff1cb222e2fa1db89 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 6 Jan 2017 21:30:33 -0500 Subject: [PATCH 02/18] remove obsolete warning about fix rigid image flag restrictions --- doc/src/fix_spring.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/src/fix_spring.txt b/doc/src/fix_spring.txt index 1d0bd47148..014a43aacc 100644 --- a/doc/src/fix_spring.txt +++ b/doc/src/fix_spring.txt @@ -89,11 +89,7 @@ NOTE: The center of mass of a group of atoms is calculated in group can straddle a periodic boundary. See the "dump"_dump.html doc page for a discussion of unwrapped coordinates. It also means that a spring connecting two groups or a group and the tether point can cross -a periodic boundary and its length be calculated correctly. One -exception is for rigid bodies, which should not be used with the fix -spring command, if the rigid body will cross a periodic boundary. -This is because image flags for rigid bodies are used in a different -way, as explained on the "fix rigid"_fix_rigid.html doc page. +a periodic boundary and its length be calculated correctly. [Restart, fix_modify, output, run start/stop, minimize info:] From 09af780aa8e6bc4890049f13de51f996eeeb89ef Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 6 Jan 2017 21:31:39 -0500 Subject: [PATCH 03/18] remove misleading comments --- src/finish.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/finish.cpp b/src/finish.cpp index 9222d4e868..e4f836a66c 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -247,7 +247,7 @@ void Finish::end(int flag) } } - // PRD stats using PAIR,BOND,KSPACE for dephase,dynamics,quench + // PRD stats if (prdflag) { if (me == 0) { @@ -329,7 +329,7 @@ void Finish::end(int flag) } } - // TAD stats using PAIR,BOND,KSPACE for neb,dynamics,quench + // TAD stats if (tadflag) { if (me == 0) { @@ -415,7 +415,7 @@ void Finish::end(int flag) } } - // HYPER stats using PAIR,BOND,KSPACE for dynamics,quench + // HYPER stats if (hyperflag) { if (me == 0) { From 33412c76edd7f9bbdfff2c61c08dc2d56060fb6b Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 9 Jan 2017 17:50:49 -0500 Subject: [PATCH 04/18] correct some formatting issues with USER-NC-DUMP --- doc/src/Section_packages.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/src/Section_packages.txt b/doc/src/Section_packages.txt index 341483d7a7..0e4b6037c1 100644 --- a/doc/src/Section_packages.txt +++ b/doc/src/Section_packages.txt @@ -1153,7 +1153,7 @@ Package, Description, Author(s), Doc page, Example, Pic/movie, Library "USER-MISC"_#USER-MISC, single-file contributions, USER-MISC/README, USER-MISC/README, -, -, - "USER-MANIFOLD"_#USER-MANIFOLD, motion on 2d surface, Stefan Paquay (Eindhoven U of Technology), "fix manifoldforce"_fix_manifoldforce.html, USER/manifold, "manifold"_manifold, - "USER-MOLFILE"_#USER-MOLFILE, "VMD"_VMD molfile plug-ins, Axel Kohlmeyer (Temple U), "dump molfile"_dump_molfile.html, -, -, VMD-MOLFILE -"USER-NC-DUMP"_#USER-NC-DUMP, dump output via NetCDF, Lars Pastewka (Karlsruhe Institute of Technology, KIT), "dump nc, dump nc/mpiio"_dump_nc.html, -, -, lib/netcdf +"USER-NC-DUMP"_#USER-NC-DUMP, dump output via NetCDF, Lars Pastewka (Karlsruhe Institute of Technology, KIT), "dump nc / dump nc/mpiio"_dump_nc.html, -, -, lib/netcdf "USER-OMP"_#USER-OMP, OpenMP threaded styles, Axel Kohlmeyer (Temple U), "Section 5.3.4"_accelerate_omp.html, -, -, - "USER-PHONON"_#USER-PHONON, phonon dynamical matrix, Ling-Ti Kong (Shanghai Jiao Tong U), "fix phonon"_fix_phonon.html, USER/phonon, -, - "USER-QMMM"_#USER-QMMM, QM/MM coupling, Axel Kohlmeyer (Temple U), "fix qmmm"_fix_qmmm.html, USER/qmmm, -, lib/qmmm @@ -1610,11 +1610,12 @@ and a "dump nc/mpiio"_dump_nc.html command to output LAMMPS snapshots in this format. See src/USER-NC-DUMP/README for more details. NetCDF files can be directly visualized with the following tools: + Ovito (http://www.ovito.org/). Ovito supports the AMBER convention - and all of the above extensions. :ulb,l +and all of the above extensions. :ulb,l VMD (http://www.ks.uiuc.edu/Research/vmd/) :l AtomEye (http://www.libatoms.org/). The libAtoms version of AtomEye contains - a NetCDF reader that is not present in the standard distribution of AtomEye :l,ule +a NetCDF reader that is not present in the standard distribution of AtomEye :l,ule The person who created these files is Lars Pastewka at Karlsruhe Institute of Technology (lars.pastewka at kit.edu). From 0db2a07993b430e02318af7844681cab8b0937cd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 9 Jan 2017 17:51:19 -0500 Subject: [PATCH 05/18] another workaround for duplicate labels (which sphinx does not like) --- doc/src/temper_grem.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/src/temper_grem.txt b/doc/src/temper_grem.txt index b41bbdf020..6145c8704c 100644 --- a/doc/src/temper_grem.txt +++ b/doc/src/temper_grem.txt @@ -32,7 +32,7 @@ Run a parallel tempering or replica exchange simulation in LAMMPS partition mode using multiple generalized replicas (ensembles) of a system defined by "fix grem"_fix_grem.html, which stands for the generalized replica exchange method (gREM) originally developed by -"(Kim)"_#Kim. It uses non-Boltzmann ensembles to sample over first +"(Kim)"_#KimStraub. It uses non-Boltzmann ensembles to sample over first order phase transitions. The is done by defining replicas with an enthalpy dependent effective temperature @@ -105,5 +105,5 @@ This command must be used with "fix grem"_fix_grem.html. [Default:] none -:link(Kim) +:link(KimStraub) [(Kim)] Kim, Keyes, Straub, J Chem Phys, 132, 224107 (2010). From d014e00e534aa2b342d6af6c3c70482439402840 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 9 Jan 2017 17:51:38 -0500 Subject: [PATCH 06/18] ignore some newly added styles from packages. --- src/.gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/.gitignore b/src/.gitignore index 6290aa9259..ff139216bb 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -374,6 +374,8 @@ /fix_meso.h /fix_meso_stationary.cpp /fix_meso_stationary.h +/fix_mscg.cpp +/fix_mscg.h /fix_msst.cpp /fix_msst.h /fix_neb.cpp @@ -394,6 +396,8 @@ /fix_nph_body.h /fix_npt_body.cpp /fix_npt_body.h +/fix_nvk.cpp +/fix_nvk.h /fix_nvt_body.cpp /fix_nvt_body.h /fix_nve_body.cpp From 1d0e600ab74b0a9c26ed0440e8ea7bd4c23639d8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 10 Jan 2017 23:47:14 -0500 Subject: [PATCH 07/18] formatting improvements and small corrections for timer settings and output discussions --- doc/src/Section_start.txt | 14 +++++++------- doc/src/timer.txt | 30 ++++++++++++++++-------------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/doc/src/Section_start.txt b/doc/src/Section_start.txt index ee122e0a72..da693a1b95 100644 --- a/doc/src/Section_start.txt +++ b/doc/src/Section_start.txt @@ -1727,7 +1727,7 @@ thermodynamic state and a total run time for the simulation. It then appends statistics about the CPU time and storage requirements for the simulation. An example set of statistics is shown here: -Loop time of 2.81192 on 4 procs for 300 steps with 2004 atoms +Loop time of 2.81192 on 4 procs for 300 steps with 2004 atoms :pre Performance: 18.436 ns/day 1.302 hours/ns 106.689 timesteps/s 97.0% CPU use with 4 MPI tasks x no OpenMP threads :pre @@ -1757,14 +1757,14 @@ Ave special neighs/atom = 2.34032 Neighbor list builds = 26 Dangerous builds = 0 :pre -The first section provides a global loop timing summary. The loop time +The first section provides a global loop timing summary. The {loop time} is the total wall time for the section. The {Performance} line is provided for convenience to help predicting the number of loop -continuations required and for comparing performance with other -similar MD codes. The CPU use line provides the CPU utilzation per +continuations required and for comparing performance with other, +similar MD codes. The {CPU use} line provides the CPU utilzation per MPI task; it should be close to 100% times the number of OpenMP -threads (or 1). Lower numbers correspond to delays due to file I/O or -insufficient thread utilization. +threads (or 1 of no OpenMP). Lower numbers correspond to delays due +to file I/O or insufficient thread utilization. The MPI task section gives the breakdown of the CPU run time (in seconds) into major categories: @@ -1791,7 +1791,7 @@ is present that also prints the CPU utilization in percent. In addition, when using {timer full} and the "package omp"_package.html command are active, a similar timing summary of time spent in threaded regions to monitor thread utilization and load balance is provided. A -new entry is the {Reduce} section, which lists the time spend in +new entry is the {Reduce} section, which lists the time spent in reducing the per-thread data elements to the storage for non-threaded computation. These thread timings are taking from the first MPI rank only and and thus, as the breakdown for MPI tasks can change from MPI diff --git a/doc/src/timer.txt b/doc/src/timer.txt index c37798cff3..358ec75a53 100644 --- a/doc/src/timer.txt +++ b/doc/src/timer.txt @@ -33,14 +33,14 @@ timer loop :pre Select the level of detail at which LAMMPS performs its CPU timings. Multiple keywords can be specified with the {timer} command. For keywords that are mutually exclusive, the last one specified takes -effect. +precedence. During a simulation run LAMMPS collects information about how much time is spent in different sections of the code and thus can provide information for determining performance and load imbalance problems. This can be done at different levels of detail and accuracy. For more information about the timing output, see this "discussion of screen -output"_Section_start.html#start_8. +output in Section 2.8"_Section_start.html#start_8. The {off} setting will turn all time measurements off. The {loop} setting will only measure the total time for a run and not collect any @@ -52,20 +52,22 @@ procsessors. The {full} setting adds information about CPU utilization and thread utilization, when multi-threading is enabled. With the {sync} setting, all MPI tasks are synchronized at each timer -call which meaures load imbalance more accuractly, though it can also -slow down the simulation. Using the {nosync} setting (which is the -default) turns off this synchronization. +call which measures load imbalance for each section more accuractly, +though it can also slow down the simulation by prohibiting overlapping +independent computations on different MPI ranks Using the {nosync} +setting (which is the default) turns this synchronization off. -With the {timeout} keyword a walltime limit can be imposed that +With the {timeout} keyword a walltime limit can be imposed, that affects the "run"_run.html and "minimize"_minimize.html commands. -This can be convenient when runs have to confirm to time limits, -e.g. when running under a batch system and you want to maximize -the utilization of the batch time slot, especially when the time -per timestep varies and is thus difficult to predict how many -steps a simulation can perform, or for difficult to converge -minimizations. The timeout {elapse} value should be somewhat smaller -than the time requested from the batch system, as there is usually -some overhead to launch jobs, and it may be advisable to write +This can be convenient when calculations have to comply with execution +time limits, e.g. when running under a batch system when you want to +maximize the utilization of the batch time slot, especially for runs +where the time per timestep varies much and thus it becomes difficult +to predict how many steps a simulation can perform for a given walltime +limit. This also applies for difficult to converge minimizations. +The timeout {elapse} value should be somewhat smaller than the maximum +wall time requested from the batch system, as there is usually +some overhead to launch jobs, and it is advisable to write out a restart after terminating a run due to a timeout. The timeout timer starts when the command is issued. When the time From 34cb4027df01d53f1b9c1797696fd0b07df2adad Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 11 Jan 2017 07:46:07 -0500 Subject: [PATCH 08/18] make formatting comment consistent --- tools/ch2lmp/charmm2lammps.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/ch2lmp/charmm2lammps.pl b/tools/ch2lmp/charmm2lammps.pl index 17b4b817af..0693c0a0ff 100755 --- a/tools/ch2lmp/charmm2lammps.pl +++ b/tools/ch2lmp/charmm2lammps.pl @@ -43,10 +43,10 @@ # General Many thanks to Paul S. Crozier for checking script validity # against his projects. # Also thanks to Xiaohu Hu (hux2@ornl.gov) and Robert A. Latour -# (latourr@clemson.edu), David Hyde-Volpe, and Tigran Abramyan, -# Clemson University and Chris Lorenz (chris.lorenz@kcl.ac.uk), -# King's College London for their efforts to add CMAP sections, -# which is implemented using the option flag "-cmap". +# (latourr@clemson.edu), David Hyde-Volpe, and Tigran Abramyan, +# Clemson University and Chris Lorenz (chris.lorenz@kcl.ac.uk), +# King's College London for their efforts to add CMAP sections, +# which is implemented using the option flag "-cmap". # Initialization From 6950a991624ebf77c3a67bcd9c8bc8c54db3d6d2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 11 Jan 2017 19:49:58 -0500 Subject: [PATCH 09/18] Revert "remove obsolete warning about fix rigid image flag restrictions" This reverts commit 51e52b477a51614fc24f85aff1cb222e2fa1db89. --- doc/src/fix_spring.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/src/fix_spring.txt b/doc/src/fix_spring.txt index 014a43aacc..1d0bd47148 100644 --- a/doc/src/fix_spring.txt +++ b/doc/src/fix_spring.txt @@ -89,7 +89,11 @@ NOTE: The center of mass of a group of atoms is calculated in group can straddle a periodic boundary. See the "dump"_dump.html doc page for a discussion of unwrapped coordinates. It also means that a spring connecting two groups or a group and the tether point can cross -a periodic boundary and its length be calculated correctly. +a periodic boundary and its length be calculated correctly. One +exception is for rigid bodies, which should not be used with the fix +spring command, if the rigid body will cross a periodic boundary. +This is because image flags for rigid bodies are used in a different +way, as explained on the "fix rigid"_fix_rigid.html doc page. [Restart, fix_modify, output, run start/stop, minimize info:] From 8e1cf6643c00d9886797570f9820dc1e13fb974a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 11 Jan 2017 20:59:40 -0500 Subject: [PATCH 10/18] apply bugfix to fix wall/gran by eric_lyster@agilent.com on lammps-users --- src/GRANULAR/fix_wall_gran.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 05933fd57c..eeec94fdf7 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -149,7 +149,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = ZCYLINDER; lo = hi = 0.0; - cylradius = force->numeric(FLERR,arg[iarg+3]); + cylradius = force->numeric(FLERR,arg[iarg+1]); iarg += 2; } else if (strcmp(arg[iarg],"region") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); From 0b081b0086ad2a7c1ce1bf21afe4b3e32190c4b7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 11 Jan 2017 21:05:32 -0500 Subject: [PATCH 11/18] whitespace cleanup --- src/GRANULAR/fix_pour.cpp | 18 ++++++++--------- src/GRANULAR/fix_wall_gran_region.cpp | 28 +++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index e8baca759d..c4e03a24a9 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -47,9 +47,9 @@ enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files /* ---------------------------------------------------------------------- */ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), radius_poly(NULL), frac_poly(NULL), - idrigid(NULL), idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), - imageflags(NULL), fixrigid(NULL), fixshake(NULL), recvcounts(NULL), + Fix(lmp, narg, arg), radius_poly(NULL), frac_poly(NULL), + idrigid(NULL), idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), + imageflags(NULL), fixrigid(NULL), fixshake(NULL), recvcounts(NULL), displs(NULL), random(NULL), random2(NULL) { if (narg < 6) error->all(FLERR,"Illegal fix pour command"); @@ -545,7 +545,7 @@ void FixPour::pre_exchange() delx = coords[m][0] - xnear[i][0]; dely = coords[m][1] - xnear[i][1]; delz = coords[m][2] - xnear[i][2]; - domain->minimum_image(delx,dely,delz); + domain->minimum_image(delx,dely,delz); rsq = delx*delx + dely*dely + delz*delz; radsum = coords[m][3] + xnear[i][3]; if (rsq <= radsum*radsum) break; @@ -650,10 +650,10 @@ void FixPour::pre_exchange() atom->radius[n] = radtmp; atom->rmass[n] = 4.0*MY_PI/3.0 * radtmp*radtmp*radtmp * denstmp; } else { - onemols[imol]->quat_external = quat; - atom->add_molecule_atom(onemols[imol],m,n,maxtag_all); - } - + onemols[imol]->quat_external = quat; + atom->add_molecule_atom(onemols[imol],m,n,maxtag_all); + } + modify->create_attribute(n); } } @@ -1006,7 +1006,7 @@ void FixPour::options(int narg, char **arg) vxhi = force->numeric(FLERR,arg[iarg+2]); vylo = force->numeric(FLERR,arg[iarg+3]); vyhi = force->numeric(FLERR,arg[iarg+4]); - if (vxlo > vxhi || vylo > vyhi) + if (vxlo > vxhi || vylo > vyhi) error->all(FLERR,"Illegal fix pour command"); vz = force->numeric(FLERR,arg[iarg+5]); iarg += 6; diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 8283c09110..d56715230a 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -44,7 +44,7 @@ enum{HOOKE,HOOKE_HISTORY,HERTZ_HISTORY,BONDED_HISTORY}; /* ---------------------------------------------------------------------- */ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : - FixWallGran(lmp, narg, arg), region(NULL), region_style(NULL), ncontact(NULL), + FixWallGran(lmp, narg, arg), region(NULL), region_style(NULL), ncontact(NULL), walls(NULL), shearmany(NULL), c2r(NULL) { restart_global = 1; @@ -57,13 +57,13 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : region_style = new char[strlen(region->style)+1]; strcpy(region_style,region->style); nregion = region->nregion; - + tmax = domain->regions[iregion]->tmax; c2r = new int[tmax]; // re-allocate atom-based arrays with nshear // do not register with Atom class, since parent class did that - + memory->destroy(shearone); shearone = NULL; @@ -71,7 +71,7 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : walls = NULL; shearmany = NULL; grow_arrays(atom->nmax); - + // initialize shear history as if particle is not touching region if (history) { @@ -117,7 +117,7 @@ void FixWallGranRegion::init() region->reset_vel(); } - if (motion_resetflag){ + if (motion_resetflag){ char str[256]; sprintf(str,"Region properties for region %s are inconsistent " "with restart file, resetting its motion",idregion); @@ -180,15 +180,15 @@ void FixWallGranRegion::post_force(int vflag) if (regiondynamic) { region->prematch(); - region->set_velocity(); + region->set_velocity(); } for (i = 0; i < nlocal; i++) { if (mask[i] & groupbit) { if (!region->match(x[i][0],x[i][1],x[i][2])) continue; - + nc = region->surface(x[i][0],x[i][1],x[i][2],radius[i]); - if (nc > tmax) + if (nc > tmax) error->one(FLERR,"Too many wall/gran/region contacts for one particle"); // shear history maintenance @@ -210,7 +210,7 @@ void FixWallGranRegion::post_force(int vflag) walls[i][0] = iwall; for (m = 0; m < sheardim; m++) shearmany[i][0][m] = 0.0; - } else if (ncontact[i] > 1 || iwall != walls[i][0]) + } else if (ncontact[i] > 1 || iwall != walls[i][0]) update_contacts(i,nc); } else update_contacts(i,nc); } @@ -233,12 +233,12 @@ void FixWallGranRegion::post_force(int vflag) // meff = effective mass of sphere // if I is part of rigid body, use body mass - + meff = rmass[i]; if (fix_rigid && mass_rigid[i] > 0.0) meff = mass_rigid[i]; // invoke sphere/wall interaction - + if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], omega[i],torque[i],radius[i],meff); @@ -453,11 +453,11 @@ void FixWallGranRegion::unpack_restart(int nlocal, int nth) double **extra = atom->extra; // skip to Nth set of extra values - + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; - + int count = ncontact[nlocal] = (int) ubuf(extra[nlocal][m++]).i; for (int iwall = 0; iwall < count; iwall++) { walls[nlocal][iwall] = (int) ubuf(extra[nlocal][m++]).i; @@ -506,5 +506,5 @@ void FixWallGranRegion::write_restart(FILE *fp) void FixWallGranRegion::restart(char *buf) { int n = 0; - if (!region->restart(buf,n)) motion_resetflag = 1; + if (!region->restart(buf,n)) motion_resetflag = 1; } From c59bcf31d1c2558c6f41e558f1a95ad1f2dc581f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 13 Jan 2017 08:10:51 -0500 Subject: [PATCH 12/18] change $MKLROOT to $(MKLROOT) as reported by @WeiLiPenguin This closes #336 --- src/MAKE/OPTIONS/Makefile.intel_cpu | 2 +- src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi | 2 +- src/MAKE/OPTIONS/Makefile.knl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MAKE/OPTIONS/Makefile.intel_cpu b/src/MAKE/OPTIONS/Makefile.intel_cpu index b34ff47761..b7db064574 100755 --- a/src/MAKE/OPTIONS/Makefile.intel_cpu +++ b/src/MAKE/OPTIONS/Makefile.intel_cpu @@ -54,7 +54,7 @@ MPI_LIB = FFT_INC = -DFFT_MKL -DFFT_SINGLE FFT_PATH = -FFT_LIB = -L$MKLROOT/lib/intel64/ -lmkl_intel_ilp64 \ +FFT_LIB = -L$(MKLROOT)/lib/intel64/ -lmkl_intel_ilp64 \ -lmkl_sequential -lmkl_core # JPEG and/or PNG library diff --git a/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi b/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi index 74ff65d0c3..2cb37ed9fe 100644 --- a/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi +++ b/src/MAKE/OPTIONS/Makefile.intel_cpu_intelmpi @@ -54,7 +54,7 @@ MPI_LIB = FFT_INC = -DFFT_MKL -DFFT_SINGLE FFT_PATH = -FFT_LIB = -L$MKLROOT/lib/intel64/ -lmkl_intel_ilp64 \ +FFT_LIB = -L$(MKLROOT)/lib/intel64/ -lmkl_intel_ilp64 \ -lmkl_sequential -lmkl_core # JPEG and/or PNG library diff --git a/src/MAKE/OPTIONS/Makefile.knl b/src/MAKE/OPTIONS/Makefile.knl index 1260a27a12..3bc777592e 100644 --- a/src/MAKE/OPTIONS/Makefile.knl +++ b/src/MAKE/OPTIONS/Makefile.knl @@ -54,7 +54,7 @@ MPI_LIB = FFT_INC = -DFFT_MKL -DFFT_SINGLE FFT_PATH = -FFT_LIB = -L$MKLROOT/lib/intel64/ -lmkl_intel_ilp64 \ +FFT_LIB = -L$(MKLROOT)/lib/intel64/ -lmkl_intel_ilp64 \ -lmkl_sequential -lmkl_core # JPEG and/or PNG library From 78498715b49d2460778cd573f69d1d06ff31e750 Mon Sep 17 00:00:00 2001 From: Tim Mattox Date: Fri, 13 Jan 2017 13:32:15 -0500 Subject: [PATCH 13/18] Protect from divide by zero in mpi_timings() when printing results. e.g. If neighbor list(s) are never rebuilt, the Neigh time will be zero. --- src/finish.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finish.cpp b/src/finish.cpp index 9222d4e868..ebb6d5a106 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -912,7 +912,7 @@ void mpi_timings(const char *label, Timer *t, enum Timer::ttype tt, time_cpu = tmp/nprocs*100.0; // % variance from the average as measure of load imbalance - if ((time_sq/time - time) > 1.0e-10) + if ((time > 0.0) && ((time_sq/time - time) > 1.0e-10)) time_sq = sqrt(time_sq/time - time)*100.0; else time_sq = 0.0; @@ -964,7 +964,7 @@ void omp_times(FixOMP *fix, const char *label, enum Timer::ttype which, time_std /= nthreads; time_total /= nthreads; - if ((time_std/time_avg -time_avg) > 1.0e-10) + if ((time_avg > 0.0) && ((time_std/time_avg -time_avg) > 1.0e-10)) time_std = sqrt(time_std/time_avg - time_avg)*100.0; else time_std = 0.0; From 61cff85435f440df9398266d6169442fc18ad13a Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 13 Jan 2017 14:35:35 -0500 Subject: [PATCH 14/18] avoid not only division by zero, but also computing variance for short runs with insufficient resolution --- src/finish.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finish.cpp b/src/finish.cpp index 9b16222f61..015ac46cac 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -912,7 +912,7 @@ void mpi_timings(const char *label, Timer *t, enum Timer::ttype tt, time_cpu = tmp/nprocs*100.0; // % variance from the average as measure of load imbalance - if ((time > 0.0) && ((time_sq/time - time) > 1.0e-10)) + if ((time > 0.001) && ((time_sq/time - time) > 1.0e-10)) time_sq = sqrt(time_sq/time - time)*100.0; else time_sq = 0.0; @@ -964,7 +964,7 @@ void omp_times(FixOMP *fix, const char *label, enum Timer::ttype which, time_std /= nthreads; time_total /= nthreads; - if ((time_avg > 0.0) && ((time_std/time_avg -time_avg) > 1.0e-10)) + if ((time_avg > 0.001) && ((time_std/time_avg -time_avg) > 1.0e-10)) time_std = sqrt(time_std/time_avg - time_avg)*100.0; else time_std = 0.0; From 98ceb6feb1bfe914c348a2c77440bc4d11b86ff7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 13 Jan 2017 18:11:23 -0500 Subject: [PATCH 15/18] add missing html files to lammps.book --- doc/src/lammps.book | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/lammps.book b/doc/src/lammps.book index 307b182fe2..c4834dbbda 100644 --- a/doc/src/lammps.book +++ b/doc/src/lammps.book @@ -23,6 +23,7 @@ Section_history.html tutorial_drude.html tutorial_github.html +tutorial_pylammps.html body.html manifolds.html @@ -113,6 +114,7 @@ special_bonds.html suffix.html tad.html temper.html +temper_grem.html thermo.html thermo_modify.html thermo_style.html From 5abd6e5122508132f20a3445f83d15b4b4f065a8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 16 Jan 2017 11:08:48 -0500 Subject: [PATCH 16/18] reordering operations in Pair::init_style() to avoid segfaults w/o a kspace style --- src/KSPACE/pair_buck_long_coul_long.cpp | 43 +++++++++++---------- src/KSPACE/pair_lj_long_coul_long.cpp | 50 +++++++++++++------------ 2 files changed, 50 insertions(+), 43 deletions(-) diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 6504af57d9..86c9926710 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -51,6 +51,9 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; + ftable = NULL; + fdisptable = NULL; + qdist = 0.0; } /* ---------------------------------------------------------------------- @@ -230,7 +233,27 @@ void PairBuckLongCoulLong::init_style() // require an atom style with charge defined if (!atom->q_flag && (ewald_order&(1<<1))) - error->all(FLERR,"Pair style buck/long/coul/long requires atom attribute q"); + error->all(FLERR, + "Invoking coulombic in pair style buck/long/coul/long requires atom attribute q"); + + // ensure use of KSpace long-range solver, set two g_ewalds + + if (force->kspace == NULL) + error->all(FLERR,"Pair style requires a KSpace style"); + if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; + if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; + + // set rRESPA cutoffs + + if (strstr(update->integrate_style,"respa") && + ((Respa *) update->integrate)->level_inner >= 0) + cut_respa = ((Respa *) update->integrate)->cutoff; + else cut_respa = NULL; + + // setup force tables + + if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); + if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_buck_global); // request regular or rRESPA neighbor lists if neighrequest_flag != 0 @@ -271,24 +294,6 @@ void PairBuckLongCoulLong::init_style() } cut_coulsq = cut_coul * cut_coul; - - // set rRESPA cutoffs - - if (strstr(update->integrate_style,"respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; - - // ensure use of KSpace long-range solver, set two g_ewalds - - if (force->kspace == NULL) - error->all(FLERR,"Pair style requires a KSpace style"); - if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; - if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; - // setup force tables - - if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); - if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_buck_global); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 5ae607a2f0..f4c48a5bfe 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -81,10 +81,12 @@ void PairLJLongCoulLong::settings(int narg, char **arg) { if (narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - ewald_off = 0; ewald_order = 0; - options(arg, 6); - options(++arg, 1); + ewald_off = 0; + + options(arg,6); + options(++arg,1); + if (!comm->me && ewald_order == ((1<<1) | (1<<6))) error->warning(FLERR,"Using largest cutoff for lj/long/coul/long"); if (!*(++arg)) @@ -226,7 +228,26 @@ void PairLJLongCoulLong::init_style() if (!atom->q_flag && (ewald_order&(1<<1))) error->all(FLERR, - "Invoking coulombic in pair style lj/coul requires atom attribute q"); + "Invoking coulombic in pair style lj/long/coul/long requires atom attribute q"); + + // ensure use of KSpace long-range solver, set two g_ewalds + + if (force->kspace == NULL) + error->all(FLERR,"Pair style requires a KSpace style"); + if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; + if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; + + // set rRESPA cutoffs + + if (strstr(update->integrate_style,"respa") && + ((Respa *) update->integrate)->level_inner >= 0) + cut_respa = ((Respa *) update->integrate)->cutoff; + else cut_respa = NULL; + + // setup force tables + + if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); + if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_buck_global); // request regular or rRESPA neighbor lists if neighrequest_flag != 0 @@ -265,27 +286,8 @@ void PairLJLongCoulLong::init_style() } else irequest = neighbor->request(this,instance_me); } + cut_coulsq = cut_coul * cut_coul; - - // set rRESPA cutoffs - - if (strstr(update->integrate_style,"respa") && - ((Respa *) update->integrate)->level_inner >= 0) - cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; - - // ensure use of KSpace long-range solver, set g_ewald - - if (force->kspace == NULL) - error->all(FLERR,"Pair style requires a KSpace style"); - if (force->kspace) g_ewald = force->kspace->g_ewald; - if (force->kspace) g_ewald_6 = force->kspace->g_ewald_6; - - // setup force tables - - if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); - if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_lj_global); - } /* ---------------------------------------------------------------------- From 3f46b6d7829a37664f71e107a7dbb2c4957f9b21 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 16 Jan 2017 11:15:54 -0500 Subject: [PATCH 17/18] fix bugs from incorrect code synchronization --- src/KSPACE/pair_buck_long_coul_long.cpp | 1 - src/KSPACE/pair_lj_long_coul_long.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 86c9926710..eb311fe3db 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -53,7 +53,6 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) writedata = 1; ftable = NULL; fdisptable = NULL; - qdist = 0.0; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index f4c48a5bfe..90d517ca28 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -247,7 +247,7 @@ void PairLJLongCoulLong::init_style() // setup force tables if (ncoultablebits && (ewald_order&(1<<1))) init_tables(cut_coul,cut_respa); - if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_buck_global); + if (ndisptablebits && (ewald_order&(1<<6))) init_tables_disp(cut_lj_global); // request regular or rRESPA neighbor lists if neighrequest_flag != 0 From 2f13365cf5f3ef8cbb3cf1302d960c6f1062d9f0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 16 Jan 2017 17:08:00 -0500 Subject: [PATCH 18/18] avoid spurious error message, when no storage fix is active/used --- src/compute_chunk_atom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index fafcf7aee3..925c5fbf81 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -493,7 +493,7 @@ ComputeChunkAtom::~ComputeChunkAtom() { // check nfix in case all fixes have already been deleted - if (modify->nfix) modify->delete_fix(id_fix); + if (id_fix && modify->nfix) modify->delete_fix(id_fix); delete [] id_fix; memory->destroy(chunk);