Optimize threading in solvers
This MR changes several serial loops into (static) parallel loops using the aocommon tools. On my desktop (with only 8 cores), it speeds up the solver by 20%. However, on my lofarcore02 node with 40 cores, the speed increase is a factor of 5.5!
This performance change is not visible in the unit tests; probably because they're too small for multi-threading to make a difference. However, they also don't make the unit tests slower.
Before:
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(131): Entering test case "iterative_scalar"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(131): Leaving test case "iterative_scalar"; testing time: 3805299us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(156): Entering test case "iterative_scalar_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(156): Leaving test case "iterative_scalar_dd_intervals"; testing time: 3362565us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(173): Entering test case "iterative_uni_scalar_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(173): Leaving test case "iterative_uni_scalar_dd_intervals"; testing time: 1253351us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(190): Entering test case "iterative_duo_scalar_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(190): Leaving test case "iterative_duo_scalar_dd_intervals"; testing time: 1925482us
..
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(264): Entering test case "iterative_diagonal"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(264): Leaving test case "iterative_diagonal"; testing time: 4449086us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(284): Entering test case "iterative_diagonal_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(284): Leaving test case "iterative_diagonal_dd_intervals"; testing time: 4502541us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(301): Entering test case "iterative_duo_diagonal_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(301): Leaving test case "iterative_duo_diagonal_dd_intervals"; testing time: 2312102us
..
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(367): Entering test case "iterative_full_jones"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(367): Leaving test case "iterative_full_jones"; testing time: 5732842us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(415): Entering test case "iterative_full_jones_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(415): Leaving test case "iterative_full_jones_dd_intervals"; testing time: 5430378us
..
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(30): Leaving test suite "solvers"; testing time: 32773979us
After:
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(131): Entering test case "iterative_scalar"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(131): Leaving test case "iterative_scalar"; testing time: 3782746us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(156): Entering test case "iterative_scalar_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(156): Leaving test case "iterative_scalar_dd_intervals"; testing time: 3366503us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(173): Entering test case "iterative_uni_scalar_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(173): Leaving test case "iterative_uni_scalar_dd_intervals"; testing time: 1238261us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(190): Entering test case "iterative_duo_scalar_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(190): Leaving test case "iterative_duo_scalar_dd_intervals"; testing time: 1911212us
..
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(264): Entering test case "iterative_diagonal"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(264): Leaving test case "iterative_diagonal"; testing time: 4343611us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(284): Entering test case "iterative_diagonal_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(284): Leaving test case "iterative_diagonal_dd_intervals"; testing time: 4474109us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(301): Entering test case "iterative_duo_diagonal_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(301): Leaving test case "iterative_duo_diagonal_dd_intervals"; testing time: 2273143us
..
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(367): Entering test case "iterative_full_jones"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(367): Leaving test case "iterative_full_jones"; testing time: 5581184us
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(415): Entering test case "iterative_full_jones_dd_intervals"
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(415): Leaving test case "iterative_full_jones_dd_intervals"; testing time: 5636442us
..
/home/anoko/projects/DP3/ddecal/test/unit/tSolvers.cc(30): Leaving test suite "solvers"; testing time: 32607536us
Edited by Andre Offringa