Bugfix/improve init level list order to avoid excess work
David Dickinson
Branch: bugfix/improve_init_level_list_order_to_avoid_excess_work
Branch: 8.1.1-RC
Merged
Merged pull request
Merged in bugfix/improve_init_level_list_order_to_avoid_excess_work (pull request #597)
This attempts to address a performance bug outlined in issue #173. Effectively aims to move the
override_timestep
init stage as high up the initialisation list as possible (i.e. after everything which doesn’t need to know the timestep in initialisation). This should help avoid unnecessary work during a time step change. This now avoids the following, potentially expensive steps,Destruction and recreation of the ffw plans.
The calculation of the parallel boundary connections and associated redistribute/fill objects.
Calculation of the velocity space grids (generally cheap, but does touch disk).
Reallocation of many large arrays
Some of these changes mean that some arrays may not be deallocated, allocated and zeroed. This shouldn’t have an impact (and tests indicate no change in results arises due to this), but noting here in case a bug arises.
Most of the changes here are from generated code, only the python generator has been modified manually (plus antenna and dist_fn changes for some duplication removal).