N-body problem on the GPU


I am investigating techniques how to implement direct summation n-body method on the GPU using OpenGL. N-body method is a commonly used algorithm in astophysics, molecular dynamics, fluid dynamics and protein folding simulations. In n-body algorithm, the net force on any body is the force exerted on it by all other bodies.

I want to discuss what would be the best tehnique to implement such a method on the GPU. If I go ahead and use the basic “for” loops on the GPU, I could not simulate for more than 65000 particles as current generation of GPUs only support upto 65000 iterations. Is there some other to hack it and be able to simulate direct summation method for more than 65000 particles.


Simple path of use GPU, you know, - for generation advanced SIMD. Where the instruction is the shader, are data is are textures. If so and necessary, to break of program on instructions and execute in a few pass.


I can’t really follow what you are saying. I understand that english is not your first language but I would really appreciate if you can elaborate more on your suggestion.


  • FMS

You might want to read this presentation, which has some details on implementing an n-body simulation on the GPU:

Sorry… I can to add (to repeate a banal thing). You can to divide your CPU n-body algorithm by successions in a sense GPU SIMD instructions and in series executing theirs. The result of every instructions into framebuffer and you can to get his. So unnecessary to write algorithm into only one shader.