[gmx-developers] replica exchange -- coordinates versus energy
Mark.Abraham at anu.edu.au
Wed Mar 19 02:38:22 CET 2008
servaas michielssens wrote:
> Again a question about the replica exchange code. So we start in de do_md,
> energies are calculated in do_force and after this coordinates are updated.
> step=0, energie at step0, update the coordinates
> So at the end of step 0 you have the energy of step 0 but the
> coordinates of
> But when you come to the replica_exchange() (e.g., step=200) you pass the
> potential energy of step200 but the coordinates of step201, is this the
> case? Or what am I missing?
Yes, that is what is happening.
Ordinarily in GROMACS, forces and energies are calculated in the same
non-bonded inner loops. It would be wasteful (i.e. poorly load-balanced)
to calculate them, test for replica-exchange, and then have to calculate
them again for the replicas that exchanged successfully.
You could perhaps eliminate some of the waste by only calculating the
energies before the exchange test (since there are energy-only versions
of the inner loops - but this assumes that there are no hidden
dependencies of the energy on the force calculation, and I don't know if
there are). However, since (IIRC) there are no force-only inner loops
for the non-exchanged replicas, and they'll have to sit and wait for the
energy+force processors to finish anyway, then assuming each replica
takes the same amount of time for an energy+force evaluation, you'd
probably implement an algorithm to do an energy evaluation, do replica
exchange, then do full energy+force evaluation for all replicas. Thus
there's a wasteful repeated energy evaluation for (typically) most of
In a perfect world you could re-distribute the repeat energy evaluations
over your whole processor array, and then just continue with the
force-only evaluations but this costs a lot of overhead and will not
produce numerically-identical results.
... or you can implement the approximate version described above.
More information about the gmx-developers