e-merlin / eMERLIN_CASA_pipeline

This is CASA eMERLIN pipeline to calibrate data from the e-MERLIN array. Please fork the repository before making any changes and read the Coding Practices page in the wiki. Please add issues with the pipeline in the issues tab.
GNU General Public License v3.0
14 stars 11 forks source link

aoflagger performance #89

Closed jmoldon closed 6 years ago

jmoldon commented 6 years ago

Summary

For reasonably amount of memory available (64-128GB), we can improve aoflagger running time by a factor of about 5 just by processing each band individually. I will implement that mode in the pipeline by default.

Details

I have been doing tests because aoflagger is the time bottleneck for many pipeline runs. The problem is that sources with low number of visibilities (like bright calibrators, small datasets, etc), it runs on memory-read mode and it is very fast (usually a few minutes per source). For large datasets, the target usually has too many visibilities, aoflagger says there is not enough memory available ("Because this is not at least twice as much, direct read mode (slower!) will be used."), and the processing time get several hours (about 5h for example).

I have run different tests forcing different modes on a 64 GB memory machine for a 24h L band dataset (225G):

The visibility counts per source are:

  ID   Code Name                RA               Decl           Epoch        nRows
  0    ACAL 1331+305            13:31:08.287300 +30.30.32.95900 J2000       957432
  1    PCAL 2007+4029           20:07:44.944855 +40.29.48.60415 J2000      3516576
  2         2032+4127           20:32:13.070000 +41.27.23.40000 J2000      8235360
  3    CAL  0319+415            03:19:48.160110 +41.30.42.10330 J2000       906696
  4    CAL  1407+284            14:07:00.394410 +28.27.14.68990 J2000       836304

I have tried different approaches:

Results

Conclusions

The most efficient seems to be auto-read-mode running per field and per band. It seems to detect the real size of each selected block and selects memory mode automatically. What I don't understand is why it does not use memory in the end (always below 5GB), I suspect it just reads scan by scan.

Usage during test4 (default per band): usage_20180130_151715

Usage during test3, direct-read: usage_20180126_135620

Usage during test1, memory read: usage_20180130_134452