Metropolis Monte Carlo Simulation of Spin Models


These programs do a Monte Carlo simulation of the two dimensional ferromagnetic Ising spin model. This is a model of magnetic materials that is also widely used to study the properties of phase transitions.

The programs use the standard local Monte Carlo update of Metropolis et al., J. Chem. Phys. 21, 1087 (1953). The Metropolis algorithm parallelizes very easily and efficiently using standard domain decomposition, since it is regular, synchronous, and all communication is local.

Sequential code

For details on the Metropolis algorithm for the Ising spin model, see any of the following references: The sequential Fortran 77 code is based on the program given in the first reference.

Parallel code

The parallel Metropolis code is very simple, and uses standard algorithms based on domain decomposition (see Solving Problems on Concurrent Processors, Vol 1, G. Fox et al., Prentice Hall, Englewood Cliffs, NJ, 1988).

The standard fine-grained data parallel (HPF) algorithm uses a red/black checkerboard scheme to allow the lattice sites to be updated in parallel. This means only single spin values are passed in each communications step.

In the coarse-grained message passing program, it is possible to pack the data for the whole edge of the sub-lattice contained on each processor into a single message to be sent to the neighboring processor. This ``blocked'' data communication greatly reduces the latency overhead compared to the ``non-blocked'' fine-grained algorithm used in HPF. A non-blocked version of the message passing program is also provided, for performance comparisons.

Ideally an HPF compiler should be able to determine that a blocked communication algorithm can be utilized for this application, and implement this more efficient algorithm on MIMD parallel computers.


Programs available


F77	Sequential Fortran 77 code for Metropolis algorithm. 

F77mp	F77 + message passing code for Metropolis algorithm 
	on MIMD parallel computers, using the Express 
	communications library. 
	The parallel Metropolis algorithm has 2 versions, 
	using blocked and non-blocked data communication.

CMF	CMFortran code for parallel Metropolis algorithm on the 
	Connection Machine. 

HPF	HPF (and Fortran 90) code for the Metropolis algorithm.

All the codes include Makefiles and sample input and output files.


Last updated Jan 25 1995
Paul Coddington, paulc@npac.syr.edu