Skip to content

Optimizing the calculation of sky map overlapping integral

Tri Nguyen requested to merge (removed):optimize-spatiotemporal into master

The current implementation of skymap_overlap_integral is inefficient because it doesn't fully utilize Numpy array operation. I added a small change to make it use more of Numpy operation and therefore more efficient.

Pointer to the timing code and results: https://ldas-jobs.ligo.caltech.edu/~tri.nguyen/spatial_overlap_timing/. In short, for 5000 combinations of GRB and LVC sky map (NSIDE=128):

  • Old implementation: ~2000 seconds
  • New implementation: ~27 seconds
  • Improvement: x100 faster

The resulting calculations are identical. The only difference is the CPU time.

Note 1: although I haven't tested it yet, the Numpy operation should in theory scale better with the size of the sky map, meaning that for larger values of NSIDE we may achieve even better time improvement.
Note 2: my editor picked up and deleted some redundant whitespaces so please ignore it.

Edited by Tri Nguyen

Merge request reports