I’m working on a CUDA C++ simulation code that performs Molecular Dynamics (MD) and Multi-Particle Collision Dynamics (MPCD) for a system consisting of a fluid (MPCD particles) and a polymer (MD particles).
The simulation runs smoothly until a certain point in the MD simulation part, where all the MD particles’ spatial coordinates become NaN (Not a Number). This behavior suggests that there might be an issue with the particle position updates or forces being computed.
I have two questions:
What common issues might cause particle positions to become NaN in CUDA simulations?
Are there specific setup I can do for my CUDA code that I can put break points in a graphical way (like intellij) and debug this issue?
I tried debugging my code by putting printout statements