q-state Potts model metastability study
using optimized GPU-based Monte Carlo algorithms

Potts Graphic
Abstract

We implemented a GPU based parallel code to perform Monte Carlo simulations of the two dimensional q-state Potts model. The algorithm is based on a checkerboard update scheme and assigns independent random numbers generators to each thread (one thread per spin). The implementation allows to simulate systems up to ∼109 spins with an average time per spin flip of 0.147ns on a GTX 480, representing a speedup up to 155x, compared with an optimized serial code running on a CPU Intel Core 2 Duo E8400@3.0GHz.

Article

Ezequiel E. Ferrero, Juan Pablo De Francesco, Nicolás Wolovick, Sergio A. Cannas, "q-state Potts model metastability study using optimized GPU-based Monte Carlo algorithms", arXiv:1101.0876. Submitted for consideration to Computer Physics Communications.

This paper and its related code is displayed in CUDA Zone showcase.

Code

The code is freely available under GNU GPL v3.

Version 1.1:
- Added the CPU version. Minor code cleanups.

Version 1.0:
- Original release used in the article.

Compiling and Running

In order to compile and run it is advised to have the latest CUDA SDK and NVIDIA driver. It has been tested with CUDA SDK ≥2.1 and NVIDIA graphic driver ≥195.
The Makefile.{shortrun,longrun} have to be tweaked to adjust the CUDA and CUDASDK paths.
These are the compile and running commands and the expected output on a GTX 280.

$ tar zxvf cuda_potts_v1.0.tar.gz
$ cd cuda_potts_v1.0
$ make -f Makefile.shortrun
$ ./potts3
# Q: 9
# L: 1024
# Number of Samples: 3
# Minimum Temperature: 0.710000
# Maximum Temperature: 0.730000
# Temperature Step: 0.002
# Equilibration Time: 2000
# Measurement Time: 8000
# Data Acquiring Step: 50
# Number of Points: 11
# Configure RNG Time (sec): 0.075567
# Total Simulation Time (sec): 190.041782
# Temp	E	E^2	E^4	M	M^2	M^4
0.710000	-1.7382084568	3.0213714699	9.1287197612	0.8994777955	0.8090610859	0.6545823687
0.712000	-1.7266286294	2.9812495195	8.8878856117	0.8934158757	0.7981929101	0.6371150601
0.714000	-1.7135949254	2.9364108195	8.6225466819	0.8862484790	0.7854375003	0.6169156283
0.716000	-1.6991343498	2.8870607011	8.3351560079	0.8780964099	0.7710544057	0.5945282907
0.718000	-1.6811647773	2.8263198832	7.9881392028	0.8671654001	0.7519779887	0.5654773877
0.720000	-1.6579805414	2.7489066578	7.5565667495	0.8520563133	0.7260037312	0.5270923532
0.722000	-1.6211319109	2.6280831703	6.9069733747	0.8239592709	0.6789202700	0.4609635830
0.724000	-1.5029535472	2.2602656585	5.1213270434	0.7087759376	0.5041957935	0.2578229267
0.726000	-1.0986006717	1.2158660647	1.5237101344	0.1999027573	0.0590690529	0.0078597939
0.728000	-0.9555019538	0.9129881856	0.8335627609	0.0026623733	0.0000079003	0.0000000001
0.730000	-0.9408686082	0.8852374097	0.7836582739	0.0022586986	0.0000056965	0.0000000000

There is a shell script in order to measure the average spin flip time in nanoseconds and its standard deviation of 400 samples. Below there is an example again running on a GTX 280. You shall tweak the library path to CUDA before running.

$ ./run_q_l_spinflip.sh
9 512 0.54012 0.00719124
9 1024 0.517726 0.00229183
9 2048 0.494736 0.00125184
9 4096 0.482883 0.00070395
9 8192 0.479762 0.000653536
9 16384 0.478523 0.000648566

For further information look at the README file included in the tarball, inspect the code, and contact the authors.

Contact

For bugs, suggestions or questions please write to:
{ferrero,jde,nicolasw,cannas}_at_famaf.unc.edu.ar

Support

CONICET Logo NVIDIA Logo SeCyT Logo



$Date$, $Revision$