It’s pretty difficult to find the time to actually write code these days. With the goal of trying to keep up with my technical skills I’ve taken a little journey back to my roots in scientific computing. As part of growing up geek I actually wrote some simple N-body simulations (see below) on my BBC Micro. I spent some time during my BSc and PhD building better N-body codes on various types of hardware including parallel machines.
Turns out there’s a lot happening in the technical computing space and some pretty significant things to go look at if your developing on the Microsoft platform. Check out the Parallel Computing Developer Center on MSDN, HPC Server 2008 and the Nvidia CUDA Zone. I’ll be blogging more about my initial experiments with the Parallel Extensions for .NET 3.5 to write a manycore enabled N-body simulation. I’ll also be writing about my upcoming build of an Intel i7 development machine for writing and running the code on. The bits arrive tomorrow so I’ll be building it next week right after I get back from Vegas.
The ultimate goal is to write a complete code that runs on a heterogeneous manycore system using both the i7 CPU and Nvidia GPUs. In between holding down my day job and getting some climbing done.
What’s this N-body thing?
N-body codes model the motion of a large number of bodies interacting under the influence of their collective gravitational field. A great tutorial on N-body modeling can be found here:
The Maya project is directed toward the construction of an open laboratory for dense stellar systems, such as star clusters, star forming regions, and galactic nuclei containing one or more massive black holes. The presentation is centered around dialogues between two astrophysicists who are developing the Kali code for simulating dense stellar systems. In the process, they construct an open lab, Maya, to set up initial conditions, run the Kali code, and analyze the results.
Many computational problems – like ray tracing – are embarrassingly parallel, meaning partitioning the calculation across many processors or cores is relatively easy. It turns out that the N-body problem is particularly interesting from a parallel computing perspective because it doesn’t parallelize particularly well. Simulating a system of bodies – like stars – involves calculating the forces on them at each time interval and then updating their velocities and positions. The problem is hard because each body needs to use the position and mass of all the other bodies in order to calculate the force acting on it. More on this later.