2 small bug fixes to load balancing
This commit is contained in:
@ -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
|
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.
|
6.0 having their value ramped in an inverse manner.
|
||||||
|
|
||||||
Only some pair potentials support the use of the {inner} and {middle}
|
Note that you can use {inner} and {outer} without using {middle} to
|
||||||
and {outer} keywords. If not, only the {pair} keyword can be used
|
split the pairwise computations into two portions instead of three.
|
||||||
with that pair style, meaning all pairwise forces are computed at the
|
Unless you are using a very long pairwise cutoff, a 2-way split is
|
||||||
same rRESPA level. See the doc pages for individual pair styles for
|
often faster than a 3-way split, since it avoids too much duplicate
|
||||||
details.i
|
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
|
Another option for using pair potentials with rRESPA is with the
|
||||||
{hybrid} keyword, which requires the use of the "pair_style hybrid or
|
{hybrid} keyword, which requires the use of the "pair_style hybrid or
|
||||||
|
|||||||
@ -350,13 +350,13 @@ void Balance::command(int narg, char **arg)
|
|||||||
domain->set_local_box();
|
domain->set_local_box();
|
||||||
|
|
||||||
// move particles to new processors via irregular()
|
// 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);
|
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
||||||
Irregular *irregular = new Irregular(lmp);
|
Irregular *irregular = new Irregular(lmp);
|
||||||
if (wtflag) fixstore->disable = 0;
|
if (wtflag) fixstore->disable = 0;
|
||||||
if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc);
|
if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc);
|
||||||
else irregular->migrate_atoms(1);
|
else irregular->migrate_atoms(1);
|
||||||
if (wtflag) fixstore->disable = 1;
|
|
||||||
delete irregular;
|
delete irregular;
|
||||||
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
||||||
|
|
||||||
@ -377,9 +377,11 @@ void Balance::command(int narg, char **arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// imbfinal = final imbalance
|
// imbfinal = final imbalance
|
||||||
|
// set disable = 1, so weights no longer migrate with atoms
|
||||||
|
|
||||||
double maxfinal;
|
double maxfinal;
|
||||||
double imbfinal = imbalance_factor(maxfinal);
|
double imbfinal = imbalance_factor(maxfinal);
|
||||||
|
if (wtflag) fixstore->disable = 1;
|
||||||
|
|
||||||
// stats output
|
// stats output
|
||||||
|
|
||||||
@ -540,6 +542,8 @@ void Balance::weight_storage(char *prefix)
|
|||||||
fixstore = (FixStore *) modify->fix[modify->nfix-1];
|
fixstore = (FixStore *) modify->fix[modify->nfix-1];
|
||||||
} else fixstore = (FixStore *) modify->fix[ifix];
|
} else fixstore = (FixStore *) modify->fix[ifix];
|
||||||
|
|
||||||
|
// do not carry weights with atoms during normal atom migration
|
||||||
|
|
||||||
fixstore->disable = 1;
|
fixstore->disable = 1;
|
||||||
|
|
||||||
if (prefix) delete [] fixargs[0];
|
if (prefix) delete [] fixargs[0];
|
||||||
|
|||||||
@ -114,6 +114,7 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
if (nevery) force_reneighbor = 1;
|
if (nevery) force_reneighbor = 1;
|
||||||
lastbalance = -1;
|
lastbalance = -1;
|
||||||
|
next_reneighbor = -1;
|
||||||
|
|
||||||
// compute initial outputs
|
// compute initial outputs
|
||||||
|
|
||||||
@ -248,6 +249,10 @@ void FixBalance::pre_neighbor()
|
|||||||
if (!pending) return;
|
if (!pending) return;
|
||||||
imbfinal = balance->imbalance_factor(maxloadperproc);
|
imbfinal = balance->imbalance_factor(maxloadperproc);
|
||||||
pending = 0;
|
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
|
// reset proc sub-domains
|
||||||
// check and warn if any proc's subbox is smaller than neigh skin
|
// 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();
|
if (domain->triclinic) domain->set_lamda_box();
|
||||||
domain->set_local_box();
|
domain->set_local_box();
|
||||||
domain->subbox_too_small_check(neighbor->skin);
|
domain->subbox_too_small_check(neighbor->skin);
|
||||||
|
|
||||||
// move atoms to new processors via irregular()
|
// 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
|
// 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 (domain->triclinic) domain->x2lamda(atom->nlocal);
|
||||||
if (wtflag) balance->fixstore->disable = 0;
|
if (wtflag) balance->fixstore->disable = 0;
|
||||||
if (lbstyle == BISECTION) irregular->migrate_atoms(0,1,sendproc);
|
if (lbstyle == BISECTION) irregular->migrate_atoms(0,1,sendproc);
|
||||||
else if (irregular->migrate_check()) irregular->migrate_atoms();
|
else if (irregular->migrate_check()) irregular->migrate_atoms();
|
||||||
if (wtflag) balance->fixstore->disable = 1;
|
|
||||||
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
||||||
|
|
||||||
// invoke KSpace setup_grid() to adjust to new proc sub-domains
|
// invoke KSpace setup_grid() to adjust to new proc sub-domains
|
||||||
|
|||||||
@ -154,8 +154,6 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller)
|
|||||||
if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
|
if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
|
||||||
else memory->create(astore,nrow,ncol,"fix/store:astore");
|
else memory->create(astore,nrow,ncol,"fix/store:astore");
|
||||||
memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
|
memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
|
||||||
|
|
||||||
// printf("AAA HOW GET HERE\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user