diff --git a/doc/src/run_style.txt b/doc/src/run_style.txt index 3240344a45..7717ede86f 100644 --- a/doc/src/run_style.txt +++ b/doc/src/run_style.txt @@ -173,11 +173,17 @@ have their force go ramped to 0.0 so the overlap with the next regime compute forces for all pairs from 5.0 outward, with those from 5.0 to 6.0 having their value ramped in an inverse manner. -Only some pair potentials support the use of the {inner} and {middle} -and {outer} keywords. If not, only the {pair} keyword can be used -with that pair style, meaning all pairwise forces are computed at the -same rRESPA level. See the doc pages for individual pair styles for -details.i +Note that you can use {inner} and {outer} without using {middle} to +split the pairwise computations into two portions instead of three. +Unless you are using a very long pairwise cutoff, a 2-way split is +often faster than a 3-way split, since it avoids too much duplicate +computation of pairwise interactions near the intermediate cutoffs. + +Also note that only a few pair potentials support the use of the +{inner} and {middle} and {outer} keywords. If not, only the {pair} +keyword can be used with that pair style, meaning all pairwise forces +are computed at the same rRESPA level. See the doc pages for +individual pair styles for details. Another option for using pair potentials with rRESPA is with the {hybrid} keyword, which requires the use of the "pair_style hybrid or diff --git a/src/balance.cpp b/src/balance.cpp index 86deb55b47..7dd13e8766 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -350,13 +350,13 @@ void Balance::command(int narg, char **arg) domain->set_local_box(); // move particles to new processors via irregular() + // set disable = 0, so weights migrate with atoms for imbfinal calculation if (domain->triclinic) domain->x2lamda(atom->nlocal); Irregular *irregular = new Irregular(lmp); if (wtflag) fixstore->disable = 0; if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc); else irregular->migrate_atoms(1); - if (wtflag) fixstore->disable = 1; delete irregular; if (domain->triclinic) domain->lamda2x(atom->nlocal); @@ -377,9 +377,11 @@ void Balance::command(int narg, char **arg) } // imbfinal = final imbalance + // set disable = 1, so weights no longer migrate with atoms double maxfinal; double imbfinal = imbalance_factor(maxfinal); + if (wtflag) fixstore->disable = 1; // stats output @@ -540,6 +542,8 @@ void Balance::weight_storage(char *prefix) fixstore = (FixStore *) modify->fix[modify->nfix-1]; } else fixstore = (FixStore *) modify->fix[ifix]; + // do not carry weights with atoms during normal atom migration + fixstore->disable = 1; if (prefix) delete [] fixargs[0]; diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index b2f545c73f..e748e0ae31 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -114,6 +114,7 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : if (nevery) force_reneighbor = 1; lastbalance = -1; + next_reneighbor = -1; // compute initial outputs @@ -248,6 +249,10 @@ void FixBalance::pre_neighbor() if (!pending) return; imbfinal = balance->imbalance_factor(maxloadperproc); pending = 0; + + // set disable = 1, so weights no longer migrate with atoms + + if (wtflag) balance->fixstore->disable = 1; } /* ---------------------------------------------------------------------- @@ -275,21 +280,23 @@ void FixBalance::rebalance() // reset proc sub-domains // check and warn if any proc's subbox is smaller than neigh skin - // since may lead to lost atoms in exchange() + // since may lead to lost atoms in comm->exchange() if (domain->triclinic) domain->set_lamda_box(); domain->set_local_box(); domain->subbox_too_small_check(neighbor->skin); // move atoms to new processors via irregular() - // only needed if migrate_check() says an atom moves to far + // for non-RCB only needed if migrate_check() says an atom moves too far // else allow caller's comm->exchange() to do it + // set disable = 0, so weights migrate with atoms + // important to delay disable = 1 until after pre_neighbor imbfinal calc + // b/c atoms may migrate again in comm->exchange() if (domain->triclinic) domain->x2lamda(atom->nlocal); if (wtflag) balance->fixstore->disable = 0; if (lbstyle == BISECTION) irregular->migrate_atoms(0,1,sendproc); else if (irregular->migrate_check()) irregular->migrate_atoms(); - if (wtflag) balance->fixstore->disable = 1; if (domain->triclinic) domain->lamda2x(atom->nlocal); // invoke KSpace setup_grid() to adjust to new proc sub-domains diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 3b1f3dca77..350e120972 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -154,8 +154,6 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller) if (vecflag) memory->create(vstore,nrow,"fix/store:vstore"); else memory->create(astore,nrow,ncol,"fix/store:astore"); memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf"); - - // printf("AAA HOW GET HERE\n"); } /* ----------------------------------------------------------------------