Preparing for Petascale Computing: A look under the hood of Barnes-Hut