Task #3076
Selectively activate MdModules during simulation instead of instantiating all of them
Description
Change the interface to MdModules that allows the MdModules to subscribe to callbacks only after they know if they are active or not so that we avoid the
if (module.active())
within the modules that may be to easily overlooked.
Associated revisions
Add function calls to MdModules to sign up for notifications
Allow MdModules to sign up to notifications after they know their own
options. This makes it possible that modules only get called back when
they need to and not by default and skips the if(active) logic in
functions that are called back in favour of not subscribing to the
notifications to begin with.
refs #3076
Change-Id: Ib95c1f734f919805c661ac6f6451af5da8187eec
History
#1 Updated by Christian Blau about 1 year ago
Selective activation of the modules is easier when MdModules don't have to be constructed with the notifications early on, but can be handed the notification handles later.
Currently all notifications are subscribed to during module construction, but some notifications will only be needed during pre-processing at grompp-time, while others are only needed during md run setup, thus
- split notifications into pre-processing notifications, notifications during simulations, and checkpointing notifications
- hand over notification handle for pre-processing callbacks and simulation callbacks seperately instead of all of them at construction time
- callback notifications only if modules are active
Split MdModuleNotifications into topics
Use different notifers to distinguish MdModule callbacks to
refs #3076
Change-Id: I08b2ff7e90e42fce44043d7c0f2a9304d404445c