Using Shared Memory for n-body problem.

Hey folks,

Can anyone give me some idea as to how I can use Shared Memory in case of a n-body problem. In my case, its for Molecular Dynamics.
I have a case, where electrostatic potential on one atom is calculated due to all other atoms, thus, it requires data of all other particles.

Therefore, if I were to use shared memory, I would have to store data for all particles in the shared memory, which is not possible, atleast thats what I could think of.

I also know that n-body example in the SDK does use shared memory, but I could not understand how it is working.

Can somebody please provide some insight into this.

Thanks.

I suggest you to read this:
[url=“http://http.developer.nvidia.com/GPUGems3/gpugems3_ch31.html”]http://http.developer.nvidia.com/GPUGems3/gpugems3_ch31.html[/url]

I think here the way you should use shared memory is explained very clearly.
Cheers,

luca