Parallel Monte Carlo simulation of the 2D Ising model using CPU and mobile GPU


  • Kherzie Andrei G. Andal ⋅ PH Department of Physical Sciences, Polytechnic University of the Philippines
  • Rhenish C. Simon ⋅ PH Physics Department, De La Salle University, Manila


We implement the checkerboard Metropolis algorithm utilizing the multiple threads and cores from the CPU and mobile GPU. The specifications of the computing system include an Intel i5-11400H CPU, 16GB RAM, and Nvidia RTX 3050 Laptop GPU. Python is used as the programming language using Jupyter notebooks. The parallel-CPU implementation can be up to 390× faster than the Python interpreter and 2.61× faster than Python compiler through Numba. The serial Python compiler outperforms the parallel-CPU at N = (20×128) associated with drawbacks of parallel execution. The parallel-CPU outperforms the GPU when underutilized with up to 7.70× speedup, which is particularly advantageous for simulating low lattice sizes. However, the mobile GPU can reach speeds up to 11.97× than the parallel-CPU for high lattice sizes. Simulating for very high lattice sizes requires enough memory for both of the parallel-CPU and GPU implementation. The parallel CPU kernel crashes and the mobile GPU encounters memory error on high lattices. After the equilibration of the system, the average magnetization is computed. We then compare it to the analytical solution derived by Onsager [Phys. Rev. 65, 117 (1944)] to validate the accuracy of our simulation.



Article ID



Poster Session A (Materials Science, Instrumentation, and Photonics)



How to Cite

KAG Andal and RC Simon, Parallel Monte Carlo simulation of the 2D Ising model using CPU and mobile GPU, Proceedings of the Samahang Pisika ng Pilipinas 41, SPP-2023-PA-06 (2023). URL: