Since this little program behaves differently on different machines, I thought I'd post a small video of it running on an 8-core Mac Pro. It's a simple charged particle simulation. Controls for it are shown below at full-size. Arrows coming out of the spheres indicate the strength and direction of the field is (the field's gradient). Purely for visual fun enjoyment, the program optionally wraps the spheres in NASA planet images (Earth and Venus, in this case), and you can also follow around a randomly-chosen sphere.
A perhaps more interesting part lies in using OpenMP in a Cocoa program to throttle how many cores are utilized, and how to let the user dynamically control it. To this end, there is a Core selector at the top which dynamically detects the number of cores on the machine, sets up a tick-based slider with that many tick marks (1 core = far left, more cores = further right).
[Read more…]