Thursday, February 14, 2013

Tech Conference cross Parallel Computing cross Hackathon

I made new friends.
One Cluster

Virtual and real.


"making mistakes are the best way to learn" - Tom Murphy

Tom Murphy and his friends set up a workshop on High Performance Computing hackathon style at the Richard Tapia Computing Conference 2013. They gave each team a cluster- 6 motherboard, each having a dual core processor. The challenge was to calculate the most decimals in pi, the fastest way possible, in a parallel fashion. Of course you'd want to use each core to its maximum potential.

To calculate pi we used the area of a unit circle method (pi = area of unit circle).  All we do is find the area under the curve in the top right quadrant of the unit circle and then multiply by 4. So we divided the X axis into millions of units, divided it between each core and finally each core would report back the result and finito.

The MPI environment took care of keeping track of what cores (they call it ranks) exist and which can be scheduled to do some processing. We were in charge of what processing each core should do.

I learned many things

  • make freaking mistakes.
  • optimizing c++: we got a working valid solution but there was a team who did a few small, obvious (obvious now) and critical optimizations. 
    • Modifying the intervals so that we can use bit shifts instead of straight divisions
    • multiplying our current result by10^n so that our decimal number is handled more like an integer
    • use long double's (we did do this)
    • instead of taking the upper bound, take the lower bound
  • i want my own cluster
  • team work - I had just met the team I was in and was lucky to get a pack of brilliant, energetic individuals.
All and all, what a fascinating and effective way to introduce a new area.