Next: Metropolis Code in
Up: Parallel Metropolis Algorithms
Previous: Metropolis Code in
If the number of lattice sites per processor is
,
need not use the checkerboard scheme, since cannot
update neighboring sites at once.
![](img162.gif)
Notice that this algorithm, when written using a message passing language
such as Express or MPI, looks exactly the same as
the sequential algorithm!
The only difference is how the shift subroutine, which finds
neighboring spin values, is implemented:
-
sequential algorithm --- shift handles the boundary conditions.
-
parallel algorithm --- shift handles boundary conditions and does
message passing if the neighboring spin is on a different processor.
Also, for the parallel algorithm, the size variable refers to
the size of the sub-lattice on each processor, not the total lattice size.
Paul Coddington, Northeast Parallel Architectures Center at Syracuse University, paulc@npac.syr.edu