Activation of density fitting and move of module notifications
authorChristian Blau <cblau@gwdg.de>
Tue, 13 Aug 2019 13:44:36 +0000 (15:44 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 26 Aug 2019 04:02:39 +0000 (06:02 +0200)
The densityfitting code is activated by adding it to the MDModules.

Moved the MdModuleNotifications to mdrunutility to break cyclic module
dependencies between mdrun and applied_forces via MdModules and
DensityFittingModuleInfo.

Observe that this patch changes the default .mdp output. Updated
reference data accordingly. Note that the changes in .mdp output
lead to "check mdp file differences" warning in the regression tests.

refs #2283

Change-Id: I93c0dd85285cac3f9e94d2dfc7c7fcc434aa81db

23 files changed:
docs/doxygen/lib/mdmodules.md
src/gromacs/applied_forces/densityfitting.cpp
src/gromacs/applied_forces/densityfitting.h
src/gromacs/applied_forces/tests/CMakeLists.txt
src/gromacs/applied_forces/tests/densityfitting.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/gmxpreprocess/readir.h
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_DefineHandlesAssignmentOnRhs.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_EmptyInputWorks.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesMimic.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ImplicitSolventNoWorks.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricField.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricFieldOscillating.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricFieldPulsed.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_UserErrorsSilentlyTolerated.xml
src/gromacs/mdrun/mdmodules.cpp
src/gromacs/mdrun/mdmodules.h
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrunutility/mdmodulenotification.h [moved from src/gromacs/mdrun/mdmodulenotification.h with 93% similarity]
src/programs/mdrun/tests/mdmodulenotification.cpp

index a531b5a1b5957b0c8f3a28a2a3c974aa667dc155..9d6ea6bf9c54bc48a390687c3365f46c11dac6b8 100644 (file)
@@ -159,13 +159,13 @@ Callbacks to modules during setup and simulation
 During setup and simulation, modules receive required information like topologies
 and local atom sets by subscribing to callback functions.
 
-To include a notification for your module,  
+To include a notification for your module
 
-* Add the function signature for the callback function to the `notifier_type`
-  in the MdModules class
+* Add the function signature for the callback function to the
+  `MdModulesNotifier` in `mdmodulenotification.h`,
 
   ```C++
-    notifier_type = registerMdModuleNotification<...,
+    registerMdModulesNotification<...,
                       YourCallbackSignature,
                       ...,
   ```
@@ -177,11 +177,11 @@ To include a notification for your module,
 
 * Add the function you want to subscribe with in the builder,
   `notifier->subscribe(yourFunction)`
-  
+
   * To subscribe class member functions of your module, you can use lambda expressions
 
   ```C++
-    notifier->subscribe([modulePointer = yourModule.get()]
+    notifier->notifier_.subscribe([modulePointer = yourModule.get()]
       (YourCallbackSignature argument){modulePointer(argument);});
   ```
 
@@ -189,7 +189,7 @@ To include a notification for your module,
 
   ```C++
     YourCallbackSignature argument();
-    mdModules_.notifier().notify(argument);
+    mdModules_.notifier().notifier_.notify(argument);
   ```
 
 Storing non-mdp option module parameters
index be7dbbc1d4973a8bc7043e76ee4975c5f2493b32..7b8b9fb2ea359dcfcc2764c5d6694ebe8f07239c 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "densityfitting.h"
 
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 #include "gromacs/mdtypes/imdmodule.h"
 
 #include "densityfittingforceprovider.h"
@@ -67,7 +68,10 @@ namespace
 class DensityFitting final : public IMDModule
 {
     public:
-        DensityFitting() = default;
+        /*! \brief Construct the density fitting module.
+         * Allow the module to subscribe to notifications from MdModules
+         */
+        explicit DensityFitting(MdModulesNotifier * /*notifier*/){}
 
         //! From IMDModule; this class provides the mdpOptions itself
         IMdpOptionProvider *mdpOptionProvider() override { return &densityFittingOptions_; }
@@ -97,9 +101,9 @@ class DensityFitting final : public IMDModule
 
 }   // namespace
 
-std::unique_ptr<IMDModule> DensityFittingModuleInfo::create()
+std::unique_ptr<IMDModule> DensityFittingModuleInfo::create(MdModulesNotifier * notifier)
 {
-    return std::unique_ptr<IMDModule>(new DensityFitting());
+    return std::make_unique<DensityFitting>(notifier);
 }
 
 const std::string DensityFittingModuleInfo::name_ = "density-guided-simulation";
index 5be641f3157098ca0382cc6c15fdbb685854dc3a..ebdf321641d7eee7914df5357330a75db1f76a22 100644 (file)
@@ -42,6 +42,7 @@ namespace gmx
 {
 
 class IMDModule;
+struct MdModulesNotifier;
 
 /*! \libinternal \brief Information about the density fitting module.
  *
@@ -55,7 +56,7 @@ struct DensityFittingModuleInfo
      * Fitting an all-atom structure into an experimental cryo-EM density map is a
      * typical application.
      */
-    static std::unique_ptr<IMDModule> create();
+    static std::unique_ptr<IMDModule> create(MdModulesNotifier * notifier);
     //! The name of the module
     static const std::string          name_;
 };
index d9cd94c6da3c8c78bd1beeadc3ceb2b96b49c9d2..87c0275638426bf54e56c120ab766c3afe312af6 100644 (file)
@@ -33,6 +33,7 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 gmx_add_unit_test(AppliedForcesUnitTest applied_forces-test
+                  densityfitting.cpp
                   densityfittingoptions.cpp
                   densityfittingamplitudelookup.cpp
                   electricfield.cpp
index ddf950237273d4d4bf5762e54fa63eed487c72e9..a85a7d2e4652f796a5a8d52124f76ef0b59257c4 100644 (file)
@@ -48,6 +48,7 @@
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/paddedvector.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 #include "gromacs/mdtypes/enerdata.h"
 #include "gromacs/mdtypes/forceoutput.h"
 #include "gromacs/mdtypes/iforceprovider.h"
@@ -73,7 +74,8 @@ namespace
 
 TEST(DensityFittingTest, ForceOnSingleOption)
 {
-    auto densityFittingModule(DensityFittingModuleInfo::create());
+    MdModulesNotifier notifier;
+    auto densityFittingModule(DensityFittingModuleInfo::create(&notifier));
 
     // Prepare MDP inputs
     KeyValueTreeBuilder      mdpValueBuilder;
index 45bc7aa83ae6e5f6c060b1ebb7901ad99c2ad960..f15c17ba7d05f854c24c12bd27c617f11b1e998b 100644 (file)
@@ -82,6 +82,7 @@
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdrun/mdmodules.h"
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/nblist.h"
@@ -2424,7 +2425,7 @@ int gmx_grompp(int argc, char *argv[])
 
     {
         gmx::KeyValueTreeBuilder internalParameterBuilder;
-        mdModules.notifier().notify(&internalParameterBuilder);
+        mdModules.notifier().notifier_.notify(&internalParameterBuilder);
         ir->internalParameters = std::make_unique<gmx::KeyValueTreeObject>(internalParameterBuilder.build());
     }
 
index 235aec60eccfcce7bd288f31aac54c40597113b4..954dcffaa924527a5030201b89ee218f3695d83d 100644 (file)
@@ -57,6 +57,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/calc_verletbuf.h"
 #include "gromacs/mdrun/mdmodules.h"
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/pull_params.h"
@@ -3051,7 +3052,7 @@ static void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char
 void do_index(const char* mdparin, const char *ndx,
               gmx_mtop_t *mtop,
               bool bVerbose,
-              const gmx::MDModules::notifier_type &notifier,
+              const gmx::MdModulesNotifier &notifier,
               t_inputrec *ir,
               warninp_t wi)
 {
@@ -3400,7 +3401,7 @@ void do_index(const char* mdparin, const char *ndx,
 
     gmx::IndexGroupsAndNames defaultIndexGroupsAndNames(
             *defaultIndexGroups, gmx::arrayRefFromArray(gnames, defaultIndexGroups->nr));
-    notifier.notify(defaultIndexGroupsAndNames);
+    notifier.notifier_.notify(defaultIndexGroupsAndNames);
 
     auto accelerations          = gmx::splitString(is->acc);
     auto accelerationGroupNames = gmx::splitString(is->accgrps);
index d6a25eca5fc6a1b5400cea84aef1118f9abe09f0..3be50585b575ec52eba40d31dfaa9816c2a45572 100644 (file)
 
 #include "gromacs/fileio/readinp.h"
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdrun/mdmodules.h"
 #include "gromacs/utility/real.h"
 
 namespace gmx
 {
 class MDModules;
+struct MdModulesNotifier;
 }
 
 struct gmx_mtop_t;
@@ -128,7 +128,7 @@ void do_index(const char                         * mdparin,
               const char                          *ndx,
               gmx_mtop_t                          *mtop,
               bool                                 bVerbose,
-              const gmx::MDModules::notifier_type &notifier,
+              const gmx::MdModulesNotifier        &notifier,
               t_inputrec                          *ir,
               warninp_t                            wi);
 /* Read the index file and assign grp numbers to atoms.
index 95038d7d536f3e7ec5f13b1838b7add1f9dc0ebb..d6a6c525a8eb2c5d046e4ed04a93aa02c1998bb6 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index c0edc1f5e23bbd3d6feb492d3c55d7fa5cd9ed80..1ad5d1e06d8fe3b3037f2f0e7f9fd08d556e7c82 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index 538864d80b4f277563b948d07118fd96d97ef8e2..e643904413af1eb697e61e1f3cf29359e561b8c2 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index 55c0ed7e3b14b7321305f0ea3f07540975fe7d76..b9f5f4b6db2b9eac6f1bb6bc3c5ec797861e8274 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index cc6a71bdc678a736d4fe52493ba992faef50c556..5e82a412126274b1621b54b0f058f5bd34e38456 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index c0edc1f5e23bbd3d6feb492d3c55d7fa5cd9ed80..1ad5d1e06d8fe3b3037f2f0e7f9fd08d556e7c82 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index 9f2bcabde7cdd6e175e538aa3b9507ab903a4f17..83176825700dfc9d8db5c49c9fd9f05d253c1438 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 1.2 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index 8b52b14d80417c7e7a905c50367ced90d6d53861..2041c81ec1a4cce8266191daaefff20d53350861 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 3.7 7.5 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index 4b2df698fa3c7346b1efce445a9a3a080305a02c..518fe2c5e8eda99e388b2546c324aae89b0f5bad 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 3.7 2 6.5 1
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index c0edc1f5e23bbd3d6feb492d3c55d7fa5cd9ed80..1ad5d1e06d8fe3b3037f2f0e7f9fd08d556e7c82 100644 (file)
@@ -317,5 +317,6 @@ userreal4                = 0
 electric-field-x         = 0 0 0 0
 electric-field-y         = 0 0 0 0
 electric-field-z         = 0 0 0 0
+density-guided-simulation-active = false
 </String>
 </ReferenceData>
index afc285a141c779106d468269977d5a83da056163..2f1119c06eed5f746b685f10ada7aaa331fbdbcd 100644 (file)
 
 #include <memory>
 
+#include "gromacs/applied_forces/densityfitting.h"
 #include "gromacs/applied_forces/electricfield.h"
 #include "gromacs/imd/imd.h"
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 #include "gromacs/mdtypes/iforceprovider.h"
 #include "gromacs/mdtypes/imdmodule.h"
 #include "gromacs/mdtypes/imdoutputprovider.h"
@@ -62,7 +64,8 @@ class MDModules::Impl : public IMDOutputProvider
     public:
 
         Impl()
-            : field_(createElectricFieldModule()),
+            : densityFitting_(DensityFittingModuleInfo::create(&notifier_)),
+              field_(createElectricFieldModule()),
               imd_(createInteractiveMolecularDynamicsModule()),
               swapCoordinates_(createSwapCoordinatesModule())
         {
@@ -73,6 +76,7 @@ class MDModules::Impl : public IMDOutputProvider
             // Create a section for applied-forces modules
             auto appliedForcesOptions = options->addSection(OptionSection("applied-forces"));
             field_->mdpOptionProvider()->initMdpOptions(&appliedForcesOptions);
+            densityFitting_->mdpOptionProvider()->initMdpOptions(&appliedForcesOptions);
             // In future, other sections would also go here.
         }
 
@@ -81,12 +85,15 @@ class MDModules::Impl : public IMDOutputProvider
                         bool bAppendFiles, const gmx_output_env_t *oenv) override
         {
             field_->outputProvider()->initOutput(fplog, nfile, fnm, bAppendFiles, oenv);
+            densityFitting_->outputProvider()->initOutput(fplog, nfile, fnm, bAppendFiles, oenv);
         }
         void finishOutput() override
         {
             field_->outputProvider()->finishOutput();
+            densityFitting_->outputProvider()->finishOutput();
         }
 
+        std::unique_ptr<IMDModule>      densityFitting_;
         std::unique_ptr<IMDModule>      field_;
         std::unique_ptr<ForceProviders> forceProviders_;
         std::unique_ptr<IMDModule>      imd_;
@@ -104,7 +111,7 @@ class MDModules::Impl : public IMDOutputProvider
         std::vector< std::shared_ptr<IMDModule> > modules_;
 
         //! Manages resources and notifies the MD modules when available
-        MDModules::notifier_type notifier_;
+        MdModulesNotifier notifier_;
 };
 
 MDModules::MDModules() : impl_(new Impl)
@@ -119,11 +126,13 @@ void MDModules::initMdpTransform(IKeyValueTreeTransformRules *rules)
 {
     auto appliedForcesScope = rules->scopedTransform("/applied-forces");
     impl_->field_->mdpOptionProvider()->initMdpTransform(appliedForcesScope.rules());
+    impl_->densityFitting_->mdpOptionProvider()->initMdpTransform(appliedForcesScope.rules());
 }
 
 void MDModules::buildMdpOutput(KeyValueTreeObjectBuilder *builder)
 {
     impl_->field_->mdpOptionProvider()->buildMdpOutput(builder);
+    impl_->densityFitting_->mdpOptionProvider()->buildMdpOutput(builder);
 }
 
 void MDModules::assignOptionsToModules(const KeyValueTreeObject  &params,
@@ -161,6 +170,7 @@ ForceProviders *MDModules::initForceProviders()
                        "Force providers initialized multiple times");
     impl_->forceProviders_ = std::make_unique<ForceProviders>();
     impl_->field_->initForceProviders(impl_->forceProviders_.get());
+    impl_->densityFitting_->initForceProviders(impl_->forceProviders_.get());
     for (auto && module : impl_->modules_)
     {
         module->initForceProviders(impl_->forceProviders_.get());
@@ -173,7 +183,7 @@ void MDModules::add(std::shared_ptr<gmx::IMDModule> module)
     impl_->modules_.emplace_back(std::move(module));
 }
 
-const MDModules::notifier_type &MDModules::notifier()
+const MdModulesNotifier &MDModules::notifier()
 {
     return impl_->notifier_;
 }
index 1e4745198cd8caba6af2169d490196798c9017ed..6f0aee6e5ff0c42aa676b2b3a1a80a50339da393 100644 (file)
@@ -43,7 +43,6 @@
 #ifndef GMX_MDRUN_MDMODULES_H
 #define GMX_MDRUN_MDMODULES_H
 
-#include "gromacs/mdrun/mdmodulenotification.h"
 #include "gromacs/utility/classhelpers.h"
 
 struct ForceProviders;
@@ -57,22 +56,9 @@ class KeyValueTreeObjectBuilder;
 class KeyValueTreeObject;
 class IKeyValueTreeErrorHandler;
 class IKeyValueTreeTransformRules;
-class IMDOutputProvider;
-class KeyValueTreeObject;
-class KeyValueTreeBuilder;
 class IMDModule;
-class LocalAtomSetManager;
-class IndexGroupsAndNames;
-
-/*! \libinternal \brief
- * \brief Signals that the communication record is set up and provides this record.
- */
-struct CommunicationIsSetup
-{
-    //! The communication record that is set up.
-    const t_commrec &communicationRecord_;
-};
-
+class IMDOutputProvider;
+struct MdModulesNotifier;
 
 /*! \libinternal \brief
  * Manages the collection of all modules used for mdrun.
@@ -109,15 +95,6 @@ class MDModules
         MDModules();
         ~MDModules();
 
-        //! Register callback function types for MDModules
-        using notifier_type = registerMdModuleNotification<
-                    CommunicationIsSetup,
-                    IndexGroupsAndNames,
-                    KeyValueTreeBuilder*,
-                    const KeyValueTreeObject &,
-                    LocalAtomSetManager *
-                    >::type;
-
         /*! \brief
          * Initializes a transform from mdp values to sectioned options.
          *
@@ -190,11 +167,11 @@ class MDModules
          * MDModules should not change after some point, we should move this
          * to a builder class.
          */
-        void add(std::shared_ptr<gmx::IMDModule> module);
+        void add(std::shared_ptr<IMDModule> module);
 
         /*! \brief Return a handle to the callbacks.
          */
-        const notifier_type &notifier();
+        const MdModulesNotifier &notifier();
 
     private:
         class Impl;
index 4a7622c19b8cb1da7e41e3e2e3a8daccd64eaddb..7155d712281a177d01c7f411a12107b123f4ec33 100644 (file)
 #include "gromacs/mdlib/qmmm.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/stophandler.h"
-#include "gromacs/mdrun/mdmodulenotification.h"
 #include "gromacs/mdrun/mdmodules.h"
 #include "gromacs/mdrun/simulationcontext.h"
 #include "gromacs/mdrunutility/handlerestart.h"
 #include "gromacs/mdrunutility/logging.h"
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 #include "gromacs/mdrunutility/multisim.h"
 #include "gromacs/mdrunutility/printtime.h"
 #include "gromacs/mdrunutility/threadaffinity.h"
@@ -799,9 +799,11 @@ int Mdrunner::mdrunner()
 
     // TODO: Error handling
     mdModules_->assignOptionsToModules(*inputrec->params, nullptr);
+    const auto &mdModulesNotifier = mdModules_->notifier().notifier_;
+
     if (inputrec->internalParameters != nullptr)
     {
-        mdModules_->notifier().notify(*inputrec->internalParameters);
+        mdModulesNotifier.notify(*inputrec->internalParameters);
     }
 
     if (fplog != nullptr)
@@ -984,7 +986,6 @@ int Mdrunner::mdrunner()
                           useGpuForNonbonded || (emulateGpuNonbonded == EmulateGpuNonbonded::Yes), *hwinfo->cpuInfo);
 
     LocalAtomSetManager atomSets;
-
     if (PAR(cr) && !(EI_TPI(inputrec->eI) ||
                      inputrec->eI == eiNM))
     {
@@ -992,7 +993,7 @@ int Mdrunner::mdrunner()
                                            &mtop, inputrec,
                                            box, positionsFromStatePointer(globalState.get()),
                                            &atomSets);
-        mdModules_->notifier().notify(&atomSets);
+        mdModulesNotifier.notify(&atomSets);
         // Note that local state still does not exist yet.
     }
     else
@@ -1287,7 +1288,7 @@ int Mdrunner::mdrunner()
     t_nrnb nrnb;
     if (thisRankHasDuty(cr, DUTY_PP))
     {
-        mdModules_->notifier().notify(CommunicationIsSetup {*cr});
+        mdModulesNotifier.notify(*cr);
         /* Initiate forcerecord */
         fr                 = new t_forcerec;
         fr->forceProviders = mdModules_->initForceProviders();
similarity index 93%
rename from src/gromacs/mdrun/mdmodulenotification.h
rename to src/gromacs/mdrunutility/mdmodulenotification.h
index dcb273a617d1c29f64cedf2872ed734ca2266070..dea6e1637f1d1678d40cce37ea6d1fef7342a695 100644 (file)
  *
  * \author Christian Blau <blau@kth.se>
  * \inlibraryapi
- * \ingroup module_mdrun
+ * \ingroup module_mdrunutility
  */
 
-#ifndef GMX_MDRUN_MDMODULENOTIFICATION_H
-#define GMX_MDRUN_MDMODULENOTIFICATION_H
+#ifndef GMX_MDRUNUTILITY_MDMODULENOTIFICATION_H
+#define GMX_MDRUNUTILITY_MDMODULENOTIFICATION_H
 
 #include <functional>
 #include <vector>
@@ -194,6 +194,22 @@ struct registerMdModuleNotification<CurrentCallParameter, CallParameter...>
     using type = MdModuleNotification<CurrentCallParameter, next_type>;
 };
 
+class KeyValueTreeObject;
+class KeyValueTreeBuilder;
+class LocalAtomSetManager;
+class IndexGroupsAndNames;
+
+struct MdModulesNotifier
+{
+//! Register callback function types for MdModule
+    registerMdModuleNotification<
+        const t_commrec &,
+        IndexGroupsAndNames,
+        KeyValueTreeBuilder *,
+        const KeyValueTreeObject &,
+        LocalAtomSetManager *>::type notifier_;
+};
+
 } // namespace gmx
 
 #endif
index da70de70b7c53cfa5dea42fc9773a6eb82d6de1a..c7356f1a19b1f13c14da98671b37520d6cdb141d 100644 (file)
@@ -43,7 +43,7 @@
 
 #include <gmock/gmock.h>
 
-#include "gromacs/mdrun/mdmodulenotification.h"
+#include "gromacs/mdrunutility/mdmodulenotification.h"
 
 namespace gmx
 {