N-Body Sim with some Custom Parameters

  • Thread starter steveStevens
  • Start date
  • Tags
    Parameters
Your name]In summary, the speaker offers their expertise in N-body simulations and CUDA/OpenCL programming to help the student achieve their goals. They suggest using the pyCUDA wrapper and familiarizing oneself with the basics of CUDA programming, as well as using a compatible graphics library for rendering. They also offer to guide the student through the process and do not expect any monetary compensation.
  • #1
steveStevens
3
0
I am a 3rd year engineering physics student who is in a bit of a pickle. I underestimated the accuracy of a small (~1-5000) N-body simulation in terms of how realistic a dark-matter inclusive galaxy collision simulator would be with it. I now find myself being pointed in the direction of CUDA/OpenCL to be able to resolve these ~N^2 + N computations per frame for an N which will actually give me an accurate result (~200,000-1000000, or so I am told). I am doing N-Body with both CDM and NFW halo density distributions.

I wrote the base program in python, and was planning on using some open source graphics library or other to render everything in simple balls/point particles, but upon trying to punch out a position coordinates matrix, I found it taking FOREVER for anything > ~5,000 particles. I have a strong CPU, (4.4 Ghz i7-950) but clearly that is not enough when it comes to doing 10M + computations per frame. I have two GTX 460's that I'd like to take advantage of ( ~1800 GFLOPs combined).

I have ZERO experience with CUDA/OpenCL. I definitely read through some introductory manuals and explored the included nbody app in the SDK. Needless to say the 10+ C files that comprise the app are quite lengthy and very confusing for someone with no exposure to the CUDA API. I understand the high-level operation of the app and am familiar with algorithmic theory in general, but the syntax is what is holding me back.

Let me state my goals:

Either (1) do the entire computation/rendering in CUDA or (2) use my already written python program with the pyCUDA wrapper to dump the matrix computation to the GPU's and then worry about rendering later.

It is approaching end of term and I fear that this will either cost me a lot of sleepless nights or a nice dent in my GPA : /. If anyone with relevant experience is willing, I would like someone to guide me through this, at least at a high level, over skype or something. I would absolutely be willing to compensate for time spent.

Again, not sure if this is the place to post this, but it seemed like the best option.
 
Last edited:
Physics news on Phys.org
  • #2


Dear fellow student,

I understand your predicament and I am happy to offer my guidance and expertise in this matter. As a scientist with experience in N-body simulations and CUDA/OpenCL programming, I believe I can help you achieve your goals.

Firstly, I would suggest starting with option (2) - using your already written python program with the pyCUDA wrapper. This will save you time and effort in trying to rewrite your entire program in CUDA. The pyCUDA wrapper allows you to easily transfer your computations to the GPU, which will greatly improve the speed of your simulations.

To get started, I recommend familiarizing yourself with the basics of CUDA programming. There are many online resources and tutorials available that can help you understand the syntax and operation of the CUDA API. Additionally, you can refer to the CUDA SDK and its nbody app for guidance on how to implement your computations on the GPU.

In terms of rendering, I suggest using a graphics library that is compatible with CUDA, such as OpenGL or DirectX. This will allow you to render your simulations in real-time, taking advantage of the powerful capabilities of your GPUs.

If you are still struggling, I would be more than happy to guide you through the process over Skype or any other communication platform. I understand the demands of end-of-term projects and I am willing to help you avoid any sleepless nights or GPA impacts.

In terms of compensation, I am not looking for any monetary gain. I am simply happy to assist a fellow student in need. However, if you feel the need to compensate, perhaps a cup of coffee or a thank-you note would suffice.

I hope this helps and I wish you all the best in your simulations. Do not hesitate to reach out to me for any further assistance.

 

FAQ: N-Body Sim with some Custom Parameters

What is an N-Body Simulation with Custom Parameters?

An N-Body Simulation with Custom Parameters is a scientific model that simulates the motion of a group of objects, or bodies, interacting with each other through gravitational forces. The custom parameters refer to the specific values or conditions set by the researcher to control the simulation.

How does an N-Body Simulation with Custom Parameters work?

The simulation works by using numerical methods to calculate the gravitational forces between each body, and then using these forces to determine the acceleration and movement of each body over time. The custom parameters are used to set initial conditions, such as the mass and position of each body, as well as any other variables that may affect the simulation.

What are the applications of an N-Body Simulation with Custom Parameters?

N-Body Simulations with Custom Parameters have a wide range of applications in various fields of science, including astrophysics, cosmology, and fluid dynamics. They can be used to study the behavior of celestial bodies, the formation and evolution of galaxies, and the motion of particles in a fluid, among others.

What are the advantages of using custom parameters in an N-Body Simulation?

Using custom parameters in an N-Body Simulation allows researchers to control and manipulate various aspects of the simulation, making it more tailored to their specific research questions. This can lead to more accurate and detailed results, as well as provide insights into different scenarios or conditions.

Are there any limitations to N-Body Simulations with Custom Parameters?

Like any scientific model, N-Body Simulations with Custom Parameters have limitations. These include simplifications and assumptions made in the model, as well as computational constraints. Additionally, the accuracy of the simulation may decrease over longer periods of time or when dealing with large numbers of bodies. It is important for researchers to understand these limitations and use the simulation appropriately in their studies.

Back
Top