NVIDIA / ising-gpu

GPU-accelerated Monte Carlo simulations of 2D Ising Model
MIT License
49 stars 26 forks source link

The python code of ising-gpu has problem. #1

Closed liufengyinxue closed 4 years ago

liufengyinxue commented 4 years ago

I execute the command "python ising_basic.py -x 2048 -y 2048 -n 100" five times, but I get the same configuration of the Ising model every time (i.e. the same "final_rank0.txt"). However, this is Monte Carlo simulation, so it should be wrong. I did not inspect the details of this code. Can someone fix it?

My OS: ubuntu 16.04 GPU: Quadro P4000

Thank you very much!

romerojosh commented 4 years ago

The code uses a fixed default seed (see here: https://github.com/NVIDIA/ising-gpu/blob/master/basic_python/ising_basic.py#L48). Unless you provide a different seed (via the -s command line argument), running the code repeatedly will produce the same result. Hope that helps!

liufengyinxue commented 4 years ago

The code uses a fixed default seed (see here: https://github.com/NVIDIA/ising-gpu/blob/master/basic_python/ising_basic.py#L48). Unless you provide a different seed (via the -s command line argument), running the code repeatedly will produce the same result. Hope that helps!

Thank you very much! I use the RNG supported by cupy (i.e. cupy.random), so I do not know the details of the RNG. I'm trying to use this code to do some research, and it helps me a lot, thank you again!