GPU Accelerated Ising Monte Carlo With C++ and Julia
Samuel Varner, California Institute of Technology
The Ising Model predicts spontaneous magnetization in 2D and 3D, making it one of the simplest physical models to show a phase transition. Metropolis Monte Carlo (MMC) is a popular technique to simulate lattice systems like the Ising Model. In MMC, a series of moves are attempted and subsequently accepted or rejected based on their probability as determined by the Boltzmann-weighted Hamiltonian. The main computational challenge lies in the serial nature of MMC. Taking advantage of the finite range of nearest neighbor interactions, we implement a checkerboard algorithm to perform MMC simulations where independent moves are executed in parallel across GPU threads. We also implement GPU optimized reduction algorithms for Hamiltonian and Magnetization calculations and take advantage of cuRAND for parallelized random number generation. We find that MMC simulations on the GPU take 2-3 orders of magnitude less time than CPU simulations of the same size. Lastly, we compare the speeds of CUDA.jl (Julia) and CUDA (C++) for GPU accelerated Monte Carlo. We find that CUDA.jl and Julia can produce speeds comparable to that of CUDA and C++, while requiring a fraction of the code.
Abstract Author(s): Sam Varner, Pierre Walker