Merge branch 'balance-weight-by-group' into lammps-icms
This includes pull request #130 by Iain Bethune (EPCC) with
additional modifications requested by Steve P. In contrast to
Iain's implementation, there is no modification to the group
command, but the group specific weight factors are provided
as command line arguments to the balance and fix balance
commands instead.
Here is the original description:
This feature branch introduces the concept of particle weighting, so
instead of balancing the number of particles per sub-domain instead
particles are weighted by a user-defined load_factor. The load_factor is
added as a new style in the group command, so that the weights can be
applied to logically grouped sets of atoms. The default load_factor is
1.0 so if the user does not specify anything the existing load balance
behaviour is maintained.
This is especially useful for systems when nlocal is not proportional to
the workload, for example hybrid pair_styles where some pair
interactions are more computationally intensive, and for RESPA runs with
high timestep ratios. Increasing the load_factor for particles involved
in more expensive or more frequent operations improves performance. In
my tests (atomistic BPTI in coarse-grained water, with RESPA ratios up
to 1:8) I get significant speedups over the current load balancer:
1fs/4fs on 24 cores: the default gives a 1% speedup, with load_factor
2.5 for the solute, an 11% speedup is obtained
1fs/8fs on 72 cores: the default fives a 23% speedup, with load_factor
4.0 I get 103% (more than twice as fast!)
The implementation works for both shift and rcb - actually for RCB it
makes use of the existing (but unused) wt parameter and for shift, the
number of local atoms is replaced by a weighted count. The actual load
balancing algorithms are unchanged, just the metric that is balanced.