AFD-Illinois / ipole

Polarized covariant radiative transport code
16 stars 12 forks source link

ipole is slow(er than it used to be) #23

Open bprather opened 4 years ago

bprather commented 4 years ago

From George: This branch seems to run 15% - 20% slower then master. While it certainly includes new and useful features, it would be nice to precisely understand why it's so much slower. To put this number in perspective, it would take this branch an extra ~35 node days to run the 1,000,000 image library.

Tasks:

  1. profile new & old versions of ipole to determine where the regression is
  2. Fix the regression
  3. Extra optimizations e.g. to linear algebra functions, any other low-hanging fruit based on profile
bprather commented 4 years ago

Profiles of new vs old ipole. Note that both are very nearly the same speed under profiling, pointing to the performance difference being a missed optimization. My theory is that it's the inlining hints taken out on refactor, I'm attempting to restore them now to test.

new_prof old_prof

bprather commented 3 years ago

Oft-forgotten: ipole is much faster when running analytic models than when interpolating GRMHD data. It spends a lot of time waiting on memory latency fetching and interpolating the cells nearby to a point.

Currently, ipole does this twice for most variables, as a side-effect of the slow light code. Eliminating the second interp_scalar call in cases where it's unnecessary might speed up ipole considerably when doing fast-light calculations.