From 2a6561e52af01c82106396b401ad6e19a761b31d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Wed, 10 Aug 2016 20:25:44 -0400 Subject: [PATCH 01/10] add run 0 to USER-TALLY examples to enforce shake constraints on step 0 (cherry picked from commit 433741564d166a5535bebf0e2487db6788d7871e) --- examples/USER/tally/in.force | 3 +++ examples/USER/tally/in.pe | 3 +++ examples/USER/tally/in.stress | 3 +++ 3 files changed, 9 insertions(+) diff --git a/examples/USER/tally/in.force b/examples/USER/tally/in.force index 29e0c6d4b7..bbe76a543e 100644 --- a/examples/USER/tally/in.force +++ b/examples/USER/tally/in.force @@ -25,6 +25,9 @@ neighbor 2.0 bin fix 1 all shake 0.0001 20 0 b 1 a 1 fix 2 all nvt temp 300.0 300.0 100.0 +# make certain that shake constraints are satisfied +run 0 post no + group one molecule 1 2 # the following section shows equivalences between using the force/tally compute and other computes and thermo keywords diff --git a/examples/USER/tally/in.pe b/examples/USER/tally/in.pe index 37bd18dc58..c6228cebd0 100644 --- a/examples/USER/tally/in.pe +++ b/examples/USER/tally/in.pe @@ -25,6 +25,9 @@ neighbor 2.0 bin fix 1 all shake 0.0001 20 0 b 1 a 1 fix 2 all nvt temp 300.0 300.0 100.0 +# make certain that shake constraints are satisfied +run 0 post no + group oxy type 1 group hyd type 2 diff --git a/examples/USER/tally/in.stress b/examples/USER/tally/in.stress index cf848a3737..03fd7142ae 100644 --- a/examples/USER/tally/in.stress +++ b/examples/USER/tally/in.stress @@ -25,6 +25,9 @@ neighbor 2.0 bin fix 1 all shake 0.0001 20 0 b 1 a 1 fix 2 all nvt temp 300.0 300.0 100.0 +# make certain that shake constraints are satisfied +run 0 post no + group one molecule 1 2 # the following section shows equivalences between using the stress/tally compute and other computes and thermo keywords From 730e3cb4ac9d805ef39ea2b99d03c83a5ac6bbab Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 13 Aug 2016 10:53:29 -0400 Subject: [PATCH 02/10] correct small (but harmless) logic error. (cherry picked from commit ac6f4f8a5672b98e6de350f7949630725be62195) --- src/KOKKOS/comm_kokkos.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 0fca51a0ee..3ec22c42fa 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -364,8 +364,8 @@ void CommKokkos::exchange() if(print && comm->me==0) { error->warning(FLERR,"Fixes cannot send data in Kokkos communication, " "switching to classic communication"); - print = 0; } + print = 0; exchange_comm_classic = true; } } From c88e9b46cf976f6a72b2ec664c6079e0feda575d Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 14 Aug 2016 22:01:32 -0400 Subject: [PATCH 03/10] thread timing summare needs to be marked as preformatted (cherry picked from commit b745636a67603aadb267a4d84709d16aeba2be01) --- doc/src/Section_start.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/Section_start.txt b/doc/src/Section_start.txt index 6149c38ade..94850da0d8 100644 --- a/doc/src/Section_start.txt +++ b/doc/src/Section_start.txt @@ -1785,7 +1785,7 @@ Pair | 0.5127 | 0.5147 | 0.5167 | 0.3 | 75.18 Bond | 0.0043139 | 0.0046779 | 0.0050418 | 0.5 | 0.68 Kspace | 0.070572 | 0.074541 | 0.07851 | 1.5 | 10.89 Neigh | 0.084778 | 0.086969 | 0.089161 | 0.7 | 12.70 -Reduce | 0.0036485 | 0.003737 | 0.0038254 | 0.1 | 0.55 +Reduce | 0.0036485 | 0.003737 | 0.0038254 | 0.1 | 0.55 :pre The third section lists the number of owned atoms (Nlocal), ghost atoms (Nghost), and pair-wise neighbors stored per processor. The max and min From 9babb7a4c2ae3152554a8b7ea4458f286788a1e7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Aug 2016 23:54:56 -0400 Subject: [PATCH 04/10] fix indexing bugs in accessing compute and fix labels in fix ave/histo (cherry picked from commit 579c52771813fee513300bcc69505d1750db3eac) --- src/fix_ave_histo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index 06281e2eca..ff91f53ed6 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -203,14 +203,14 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < nvalues; i++) { if (which[i] == X || which[i] == V || which[i] == F) kindflag = PERATOM; else if (which[i] == COMPUTE) { - Compute *compute = modify->compute[modify->find_compute(ids[0])]; + Compute *compute = modify->compute[modify->find_compute(ids[i])]; if (compute->scalar_flag || compute->vector_flag || compute->array_flag) kindflag = GLOBAL; else if (compute->peratom_flag) kindflag = PERATOM; else if (compute->local_flag) kindflag = LOCAL; else error->all(FLERR,"Fix ave/histo input is invalid compute"); } else if (which[i] == FIX) { - Fix *fix = modify->fix[modify->find_fix(ids[0])]; + Fix *fix = modify->fix[modify->find_fix(ids[i])]; if (fix->scalar_flag || fix->vector_flag || fix->array_flag) kindflag = GLOBAL; else if (fix->peratom_flag) kindflag = PERATOM; From c8fe3799ed334b5ed1dd14aa9bd021eab23f6123 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 15 Aug 2016 22:14:40 -0400 Subject: [PATCH 05/10] Add missing initialization (cherry picked from commit 054256cf0a85283535deccec0a1fbe5a33ca6194) --- src/velocity.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/velocity.cpp b/src/velocity.cpp index e5eb19c81d..0e964a27bc 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -151,6 +151,7 @@ void Velocity::init_external(const char *extgroup) rotation_flag = 0; loop_flag = ALL; scale_flag = 1; + bias_flag = 0; } /* ---------------------------------------------------------------------- */ From 587bafdf2de595377c50552c14234aa0bf4fc2ff Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 15 Aug 2016 22:51:41 -0400 Subject: [PATCH 06/10] Remove memory leak and unnecessary allocation (cherry picked from commit c998f7b81fb7a846b60006a3d74985a53b88cc0e) --- src/QEQ/fix_qeq_slater.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index ad1c652100..44e1a0750b 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -90,14 +90,6 @@ void FixQEqSlater::init() void FixQEqSlater::extract_streitz() { - int ntypes = atom->ntypes; - - memory->create(chi,ntypes+1,"qeq:chi"); - memory->create(eta,ntypes+1,"qeq:eta"); - memory->create(gamma,ntypes+1,"qeq:gamma"); - memory->create(zeta,ntypes+1,"qeq:zeta"); - memory->create(zcore,ntypes+1,"qeq:zcore"); - Pair *pair = force->pair_match("coul/streitz",1); if (pair == NULL) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); int tmp; From 13836840484427e3bb9bee948cca77e694d03425 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Aug 2016 11:17:18 -0400 Subject: [PATCH 07/10] fix bug in recent dump changes for -DLAMMPS_BIGBIG (cherry picked from commit a507936878611c8d63eb4f4ec90365b2a6318f9a) --- src/dump.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dump.h b/src/dump.h index e92d048b9d..c4d9335201 100644 --- a/src/dump.h +++ b/src/dump.h @@ -118,7 +118,7 @@ class Dump : protected Pointers { int *index,*proclist; double **xpbc,**vpbc; - int *imagepbc; + imageint *imagepbc; int maxpbc; class Irregular *irregular; From 5909bd54298e5ae09cb6d59ed49e332f74582597 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 21 Aug 2016 11:18:02 -0400 Subject: [PATCH 08/10] correct bug in tracking atom->nlocal vs. atom->nmax when allocating pbc enforcement buffers (cherry picked from commit 45a2dd36d0f0643d86344de44e2c260fba2e2e77) --- src/dump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dump.cpp b/src/dump.cpp index 3198429519..511abdaa87 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -276,7 +276,7 @@ void Dump::init() // preallocation for PBC copies if requested - if (pbcflag && atom->nlocal > maxpbc) pbc_allocate(); + if (pbcflag && atom->nmax > maxpbc) pbc_allocate(); } /* ---------------------------------------------------------------------- */ @@ -374,7 +374,7 @@ void Dump::write() if (pbcflag) { int nlocal = atom->nlocal; - if (nlocal > maxpbc) pbc_allocate(); + if (atom->nmax > maxpbc) pbc_allocate(); if (nlocal) { memcpy(&xpbc[0][0],&atom->x[0][0],3*nlocal*sizeof(double)); memcpy(&vpbc[0][0],&atom->v[0][0],3*nlocal*sizeof(double)); From 50a82bb345d367f16b482657e4969ab3ed4f89b7 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 22 Aug 2016 15:49:33 -0400 Subject: [PATCH 09/10] address uninitialized variable issues pointed out by valgrind/coverity --- src/fix_controller.cpp | 2 +- src/variable.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index 28f2873910..d931686515 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -197,7 +197,7 @@ void FixController::end_of_step() // invoke compute if not previously invoked - double current; + double current = 0.0; if (pvwhich == COMPUTE) { if (pvindex == 0) { diff --git a/src/variable.cpp b/src/variable.cpp index f27de2777c..05c55ec7c6 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -898,7 +898,7 @@ double Variable::compute_equal(int ivar) error->all(FLERR,"Variable has circular dependency"); eval_in_progress[ivar] = 1; - double value; + double value = 0.0; if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL); else if (style[ivar] == INTERNAL) value = dvalue[ivar]; else if (style[ivar] == PYTHON) { From 8750515cc44dbda1aa1abda46c4a374d83e48b24 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Tue, 23 Aug 2016 15:38:38 -0600 Subject: [PATCH 10/10] changed dump.cpp back to the way it was --- src/dump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dump.cpp b/src/dump.cpp index 511abdaa87..3198429519 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -276,7 +276,7 @@ void Dump::init() // preallocation for PBC copies if requested - if (pbcflag && atom->nmax > maxpbc) pbc_allocate(); + if (pbcflag && atom->nlocal > maxpbc) pbc_allocate(); } /* ---------------------------------------------------------------------- */ @@ -374,7 +374,7 @@ void Dump::write() if (pbcflag) { int nlocal = atom->nlocal; - if (atom->nmax > maxpbc) pbc_allocate(); + if (nlocal > maxpbc) pbc_allocate(); if (nlocal) { memcpy(&xpbc[0][0],&atom->x[0][0],3*nlocal*sizeof(double)); memcpy(&vpbc[0][0],&atom->v[0][0],3*nlocal*sizeof(double));