Skip to content

Refactor onepredict applybeam

Mattia Mancini requested to merge refactor_onepredict_applybeam into master

In this merge request a small refactor is done into the OnePredict and ApplyBeam to facilitate further performance optimizations. This particular part of the code it is used by the GainCal to create a predicted sky model that takes into consideration of a beam model. Currently this create in itself a performance optimization although minimal.

The followings are timings considering only 100 time steps with the following characteristics

  nchan:          150
  ncorrelations:  4
  nbaselines:     1711
  ntimes:         100
  time interval:  2.00278
  use thread:     true
  number of patches:      64
  patches clustered:      true
  number of components:   65
  absolute orientation:   false
  all unpolarized:        false
  correct freq smearing:  false

Reference running time

Total DP3 time       69.5 real      607.57 user        45.3 system
    2.7% ( 1882 ms) MSReader
   95.8% (   66  s) GainCal gaincal.
           91.4% (   60  s) of it spent in predict
            2.8% ( 1865 ms) of it spent in reordering visibility data
            5.0% ( 3302 ms) of it spent in estimating gains and computing residuals
            0.0% (    3 ms) of it spent in writing gain solutions to disk
        Converged: 91, stalled: 9, non converged: 0, failed: 0
        Iters converged: 6, stalled: 9, non converged: 0, failed: 0
    1.3% (  908 ms) MSWriter msout.
      0.0% (    0 ms) Creating task
    199.8% ( 1815 ms) Writing (threaded)

Avoid cache trashing

Total DP3 time      61.72 real      540.81 user        41.2 system
    1.9% ( 1162 ms) MSReader
   96.3% (   59  s) GainCal gaincal.
           90.4% (   53  s) of it spent in predict
            3.2% ( 1888 ms) of it spent in reordering visibility data
            5.6% ( 3340 ms) of it spent in estimating gains and computing residuals
            0.0% (    1 ms) of it spent in writing gain solutions to disk
        Converged: 91, stalled: 9, non converged: 0, failed: 0
        Iters converged: 6, stalled: 9, non converged: 0, failed: 0
    1.5% (  936 ms) MSWriter msout.
      0.2% (    1 ms) Creating task
    187.7% ( 1758 ms) Writing (threaded)

Apply beam to single model direction and add to whole model

Total DP3 time      50.22 real      440.89 user       17.29 system
    3.8% ( 1931 ms) MSReader
   94.1% (   47  s) GainCal gaincal.
           88.2% (   41  s) of it spent in predict
            3.8% ( 1783 ms) of it spent in reordering visibility data
            7.0% ( 3301 ms) of it spent in estimating gains and computing residuals
            0.0% (    4 ms) of it spent in writing gain solutions to disk
        Converged: 91, stalled: 9, non converged: 0, failed: 0
        Iters converged: 6, stalled: 9, non converged: 0, failed: 0
    1.8% (  893 ms) MSWriter msout.
      0.0% (    0 ms) Creating task
    185.1% ( 1654 ms) Writing (threaded)

Merge request reports