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

We implement the checkerboard Metropolis algorithm utilizing multiple threads and cores from both CPU and mobile GPU. The computing setup includes an Intel i5-11400H CPU, 16 GB RAM, and an Nvidia RTX 3050 Laptop GPU, with Python and Jupyter notebooks used for implementation.

The parallel CPU implementation can be up to 390x faster than the Python interpreter and 2.61x faster than Python compiled through Numba. A notable exception appears at N = (20 x 128), where compiler-based serial execution can temporarily outperform parallel CPU execution because of parallel overhead.

For low lattice sizes, the parallel CPU implementation is more efficient, with speedups up to 7.70x over mobile GPU when the GPU is underutilized. For high lattice sizes, the mobile GPU reaches up to 11.97x speedup over parallel CPU. Both approaches eventually hit memory limits at very high lattice sizes.

After equilibration, average magnetization is compared to Onsager's analytical solution to validate simulation accuracy.

Citation

Andal, K. A. G., & Simon, R. C. (2023). Parallel Monte Carlo simulation of the 2D Ising model using CPU and mobile GPU. In Proceedings of the Samahang Pisika ng Pilipinas, vol. 41.