Sharing information between processors

I have a question about performing Monte Carlo steps using LAMMPS. I know that MD parallelizes easily and that MC does not. If I want to implement a Monte Carlo step on a parallel system, what commands would I use to do that? I know that the fix bond create and break will be what I use to implement the actual Monte Carlo part of the problem, but my question is what would I need to do to perform the following steps?

  1. Pause the MD manipulation of the atoms and their positions, velocities, etc.
  2. Take all information from all the processors my simulation is using and put that atom and bond information onto one processor. (This and step four are the ones I’m most concerned about.)
  3. Once all information is on one processor, perform the MC step. Break or form bonds based on results of MC step.
  4. Spread information back over processors.
  5. Resume MD simulation until next MC step.
    Thank you in advance for any advice you may have.
    Joey Emfinger

joseph,

I have a question about performing Monte Carlo steps using LAMMPS. I know
that MD parallelizes easily and that MC does not. If I want to implement a
Monte Carlo step on a parallel system, what commands would I use to do that?

that very much depends on the kind of monte carlo step that you want to do.
most likely, you need to do this on the source code level.

I know that the fix bond create and break will be what I use to implement
the actual Monte Carlo part of the problem, but my question is what would I
need to do to perform the following steps?

Pause the MD manipulation of the atoms and their positions, velocities, etc.
Take all information from all the processors my simulation is using and put
that atom and bond information onto one processor. (This and step four are
the ones I'm most concerned about.)

this should be avoided at all cost, since that will kill parallel
performance. for creating/breaking a bond, that won't really
needed. all you need to do is to update the bond information
on the MPI ranks that "own" the bond atoms.

Once all information is on one processor, perform the MC step. Break or form
bonds based on results of MC step.
Spread information back over processors.
Resume MD simulation until next MC step.

as i wrote before, the important question is what kind of
MC step do you want to perform and what kind of information
do you need to do that. in general, if you can work with
differentials rather than gathering all information together
on one node, then you have much better chances of keeping
a decent performance.

what you seem to envision is almost like running lammps
for a bit, write out a restart, convert the restart to a data file,
read/parse/manipulate/write a new data file and then clear
the lammps status and continue the calculation. that *has*
to be horrible complicated and bad for scaling.

axel.

All of Axel's advice is sound. If I were doing this
I would model it after fix bond/break or bond/create
and do the MC operation locally on each processor
using its local info about its atoms. You can
also talk to Rob Hoy, who has posted on the mail
list in the past (search for his name, email). I think
he has worked on a more MC-like bond/break algorithm
in the past. You should also look at the fix bond/swap
code, which does do true MC on swapping a bond.

The break and create variants are more heuristic,
not true MC.

Steve