The following results are measurements of elapsed time vs total energy error for the full range of accelerators (tree codes or brute-force) available in Grav-Sim. The tests were conducted according to the following criteria:

  • A standard Plummer model was used in each test, with either 1,000, 10,000 or 100,000 bodies.
  • All calculations were done in IEEE standard double precision using the "GravSim" command-line simulator.
  • The default Hermite-6 integrator was used throughout at the default level 1.
  • The integrations were numeric-only with no analytic orbit detection.
  • Tests were performed in serial mode (i.e. one CPU only) to eliminate any effect due to the suitability or otherwise of each algorithm for parallelisation.
  • The tree-code tests were done with the opening angle "theta" set to the relatively wide default value of 0.75.
  • Timings were taken on a Pentium dual-core CPU @ 2.6 GHz with 1Gb RAM and running Windows XP.
  • No softening is used - just pure Newtonian gravity

1,000-body Plummer Model (To Simulated Time 1.0)

Time-StepsAcceleratorInteractorSpace DividerElapsed TimeEnergy Error
IndividualBarnes-HutDirectOctree5.5 seconds0.455493 %
IndividualStadel*DirectKDTree6.5 seconds0.451888 %
IndividualRidler**DirectHilbert5.4 seconds0.438864 %
IndividualDehnenPairwiseOctree5.6 seconds0.223357 %
IndividualDehnen-Stadel*PairwiseKDTree6.0 seconds0.244912 %
IndividualDehnen-Ridler**PairwiseHilbert5.8 seconds0.411655 %
IndividualBrute-ForceN/AN/A5.8 seconds0.315941 %
SharedBarnes-HutDirectOctree17.3 seconds0.031596 %
SharedStadel*DirectKDTree22.4 seconds0.038903 %
SharedRidler**DirectHilbert18.6 seconds0.001052 %
SharedDehnenPairwiseOctree14.0 seconds0.382969 %
SharedDehnen-Stadel*PairwiseKDTree17.7 seconds0.124228 %
SharedDehnen-Ridler**PairwiseHilbert14.5 seconds0.010016 %
SharedBrute-ForceN/AN/A41.6 seconds0.002367 %
ConstantBarnes-HutDirectOctree2 minutes 13 seconds400.249 %
ConstantStadelDirectKDTree2 minutes 57 seconds1.09441 %
ConstantRidler*DirectHilbert1 minute 49 seconds3.99687 %
ConstantDehnenPairwiseOctree1 minute 14.3 seconds0.397287 %
ConstantDehnen-Stadel*PairwiseKDTree1 minute 54 seconds0.101437 %
ConstantDehnen-Ridler*PairwiseHilbert1 minute 18.4 seconds0.013006 %
ConstantBrute-ForceN/AN/A4 minutes 0 seconds2.91443 %

* - note the KDTree used here is unbalanced, unlike the one implemented by Joachim Stadel
** - experimental


10,000-body Plummer Model (To Simulated Time 0.1)

Time-StepsAcceleratorInteractorSpace DividerElapsed TimeEnergy Error
IndividualBarnes-HutDirectOctree43.9 seconds0.003861 %
IndividualStadel*DirectKDTree82.1 seconds0.007884 %
IndividualRidler**DirectHilbert38.7 seconds0.001642 %
IndividualDehnenPairwiseOctree54.1 seconds0.018990 %
IndividualDehnen-Stadel*PairwiseKDTree80.4 seconds0.000480 %
IndividualDehnen-Ridler**PairwiseHilbert80.4 seconds0.008884 %
IndividualBrute-ForceN/AN/A1 minute, 52 seconds0.005719 %
SharedBarnes-HutDirectOctree3 minutes, 58 seconds0.000590 %
SharedStadel*DirectKDTree3 minutes, 27 seconds0.001791 %
SharedRidler**DirectHilbert4 minutes, 6 seconds0.005514 %
SharedDehnenPairwiseOctree2 minutes, 36 seconds0.023204 %
SharedDehnen-Stadel*PairwiseKDTree2 minutes, 28 seconds0.011385 %
SharedDehnen-Ridler**PairwiseHilbert2 minutes, 49 seconds0.014919 %
SharedBrute-ForceN/AN/A33 minutes, 6 seconds0.000178 %
ConstantBarnes-HutDirectOctree21 minutes, 26 seconds0.166846 %
ConstantStadelDirectKDTree19 minutes, 0 seconds0.169970 %
ConstantRidler*DirectHilbert21 minutes, 21 seconds13.7187 %
ConstantDehnenPairwiseOctree14 minutes, 22 seconds0.023058 %
ConstantDehnen-Stadel*PairwiseKDTree14 minutes, 38 seconds0.011628 %
ConstantDehnen-Ridler*PairwiseHilbert15 minutes, 34 seconds0.015594 %
ConstantBrute-ForceN/AN/A2 hours, 53 minutes0.123633 %

* - note the KDTree used here is unbalanced, unlike the one implemented by Joachim Stadel
** - experimental


100,000-body Plummer Model (To Simulated Time 0.01)

Time-StepsAcceleratorInteractorSpace DividerElapsed TimeEnergy Error
IndividualBarnes-HutDirectOctree2 minutes, 50 seconds0.000252 %
IndividualStadel*DirectKDTree5 minutes, 8 seconds0.000064 %
IndividualRidler**DirectHilbert2 minutes, 48 seconds0.001275 %
IndividualDehnenPairwiseOctree3 minutes, 20 seconds0.003910 %
IndividualDehnen-Stadel*PairwiseKDTree5 minutes, 28 seconds0.001213 %
IndividualDehnen-Ridler**PairwiseHilbert8 minutes, 4 seconds0.021340 %
IndividualBrute-ForceN/AN/A1 hour, 2 minutes0.000096 %
SharedBarnes-HutDirectOctree29 minutes, 15 seconds0.000209 %
SharedStadel*DirectKDTree37 minutes, 38 seconds0.000078 %
SharedRidler**DirectHilbert39 minutes, 56 seconds0.001210 %
SharedDehnenPairwiseOctree21 minutes, 23 seconds0.003887 %
SharedDehnen-Stadel*PairwiseKDTree29 minutes, 1 seconds0.001164 %
SharedDehnen-Ridler**PairwiseHilbert29 minutes, 45 seconds0.021235 %
SharedBrute-ForceN/AN/A36 hours (est)
ConstantBarnes-HutDirectOctree3 hours, 1 minutes0.000208 %
ConstantStadelDirectKDTree3 hours, 53 minutes0.000077 %
ConstantRidler*DirectHilbert4 hours, 5 minutes0.001213 %
ConstantDehnenPairwiseOctree2 hours, 7 minutes0.003887 %
ConstantDehnen-Stadel*PairwiseKDTree2 hours, 59 minutes0.001162 %
ConstantDehnen-Ridler*PairwiseHilbert2 hours, 59 minutes0.021246 %
ConstantBrute-ForceN/AN/A9 days (est)

* - note the KDTree used here is unbalanced, unlike the one implemented by Joachim Stadel
** - experimental