- #36
- 15,464
- 690
It is very hard to parallelize. Derivative computations can be expensive (e.g., a plate model for aerodynamic drag, non-spherical gravity, a throttleable rocket with a complex buildup/trailoff, a stiff set of robotic arm links, ...), and then yes, the derivative calculations vastly overwhelm the integration. Assuming simple Newtonian gravity calculations for spherical mass distributions, the problem at hand has exceeding simple derivative calculations. The overhead of coarse grain parallelism (e.g., threads) is going to swamp any gains from using threads -- particularly so if one is using a sophisticated integration technique.DrStupid said:Most of the time is used for the calculation of accelerations and this is not that difficult to parallelize. For an n-body system there are n·(n-1)/2 connections. With k processors just assign n·(n-1)/(2·k) to every processor. Simultaneous memory access can be avoided by mirroring position and mass data k times. It might be also useful to parallelize parts of the numerical integrator but everything else does not need to be optimized.
Fine-grain parallelism is a different story. It is possible to farm out the entire integration process to a GPU. It's a pain in the rear and it's not very portable, but it is doable.