16.4 Parallel algorithms for molecular dynamics 553
Particles
Forces Forces
Particles
Figure 16.6. The parallel molecular dynamics procedure. At each time step, the
particle positions are sent to the right neighbours. There, the forces on the local
particles, and on the particles just received from the left box, are calculated. These
forces are then sent back to the left slice so that they can be added to the total
force calculated there. Now the particles can be moved according to the Verlet
algorithm.
should exceed the cut-off of the Lennard–Jones force. The force evaluation is then
implemented according to the following scheme.
Send particles in slice to the right neighbour;
Receive guest particles from left neighbour;
FOR all particle pairs in present slice DO
Calculate forces for particles in present slice due to
particles in this slice and store their values;
END FOR;
FOR all particles in present slice DO
FOR all particles received from left neighbour DO
Calculate forces between ‘resident’ and ‘guest’ particle;
Store force on resident particle in resident force array;
Store force on ‘guest’ particle in a sending array
END FOR;
END FOR;
Send forces on guest particles to left neighbour;
Receive forces on resident particles from right neighbour;
Add these last forces to total forces on resident particles;
Move particles according to Verlet algorithm.
The procedure is represented in Figure 16.6.
To evaluate this method, we give results for the performance of an MD simulation
for a rectangular box of sizeNL×L×L. This was divided up intoNcubicL×
L×Lboxes, each of which was allocated to a different processor. In totalN×
2048 particles were present in the system, whereNis the number of processors.