From dab9e27d939a0db768528747fc1300dd4eca0f0c Mon Sep 17 00:00:00 2001 From: "M. Eric Irrgang" Date: Thu, 23 Apr 2020 16:03:20 +0300 Subject: [PATCH] Interface for remaining SimulatorBuilder.add() methods. Refs #3567 --- src/gromacs/mdrun/runner.cpp | 16 ++++++ src/gromacs/mdrun/simulatorbuilder.h | 97 ++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 9dbda51700..600c3b0706 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -1638,6 +1638,22 @@ int Mdrunner::mdrunner() simulatorBuilder.add(SimulatorConfig(mdrunOptions, startingBehavior, &runScheduleWork)); + simulatorBuilder.add(SimulatorEnv(fplog, cr, ms, mdlog, oenv)); + simulatorBuilder.add(Profiling(&nrnb, walltime_accounting, wcycle)); + simulatorBuilder.add(ConstraintsParam( + constr.get(), enforcedRotation ? enforcedRotation->getLegacyEnfrot() : nullptr, + vsite.get())); + // TODO: Separate `fr` to a separate add, and make the `build` handle the coupling sensibly. + simulatorBuilder.add( + LegacyInput(static_cast(filenames.size()), filenames.data(), inputrec, fr)); + simulatorBuilder.add(ReplicaExchangeParameters(replExParams)); + simulatorBuilder.add(InteractiveMD(imdSession.get())); + simulatorBuilder.add(SimulatorModules(mdModules_->outputProvider(), mdModules_->notifier())); + simulatorBuilder.add(CenterOfMassPulling(pull_work)); + // Todo move to an MDModule + simulatorBuilder.add(IonSwapping(swap)); + simulatorBuilder.add(TopologyData(&mtop, mdAtoms.get())); + // build and run simulator object based on user-input auto simulator = simulatorBuilder.build( useModularSimulator, fplog, cr, ms, mdlog, static_cast(filenames.size()), diff --git a/src/gromacs/mdrun/simulatorbuilder.h b/src/gromacs/mdrun/simulatorbuilder.h index 1401cf242b..df97f42b6f 100644 --- a/src/gromacs/mdrun/simulatorbuilder.h +++ b/src/gromacs/mdrun/simulatorbuilder.h @@ -125,6 +125,82 @@ struct SimulatorStateData SimulatorStateData(const SimulatorStateData& simulatorStateData) = default; }; +class SimulatorEnv +{ + +public: + SimulatorEnv(FILE gmx_unused* pFile, + t_commrec gmx_unused* pCommrec, + gmx_multisim_t gmx_unused* pMultisim, + const MDLogger gmx_unused& logger, + gmx_output_env_t gmx_unused* pEnv) + { + } +}; + +class Profiling +{ +public: + Profiling(t_nrnb gmx_unused* nrnb, + gmx_walltime_accounting gmx_unused* pAccounting, + gmx_wallcycle gmx_unused* pWallcycle) + { + } +}; + +class ConstraintsParam +{ +public: + ConstraintsParam(Constraints gmx_unused* pConstraints, + gmx_enfrot gmx_unused* pEnfrot, + VirtualSitesHandler gmx_unused* pVsite) + { + } +}; + +class LegacyInput +{ +public: + LegacyInput(int gmx_unused i, + const t_filenm gmx_unused* pFilenm, + t_inputrec gmx_unused* pInputrec, + t_forcerec gmx_unused* pForcerec) + { + } +}; + +class InteractiveMD +{ +public: + explicit InteractiveMD(ImdSession gmx_unused* pSession) {} +}; + +class SimulatorModules +{ +public: + SimulatorModules(IMDOutputProvider gmx_unused* pProvider, const MdModulesNotifier gmx_unused& notifier) + { + } +}; + +class CenterOfMassPulling +{ +public: + explicit CenterOfMassPulling(pull_t gmx_unused* pPull) {} +}; + +class IonSwapping +{ +public: + IonSwapping(t_swap gmx_unused* pSwap) {} +}; + +class TopologyData +{ +public: + TopologyData(gmx_mtop_t gmx_unused* pMtop, MDAtoms gmx_unused* pAtoms) {} +}; + /*! \libinternal * \brief Class preparing the creation of Simulator objects * @@ -152,6 +228,27 @@ public: // but this may not be safe and may change in the future. simulatorConfig_ = std::make_unique(simulatorConfig); } + + void add(SimulatorEnv&& /*unused*/) {} + + void add(Profiling&& /*unused*/) {} + + void add(ConstraintsParam&& /*unused*/) {} + + void add(LegacyInput&& /*unused*/) {} + + void add(ReplicaExchangeParameters&& /*unused*/) {} + + void add(InteractiveMD&& /*unused*/) {} + + void add(SimulatorModules&& /*unused*/) {} + + void add(CenterOfMassPulling&& /*unused*/) {} + + void add(IonSwapping&& /*unused*/) {} + + void add(TopologyData&& /*unused*/) {} + /*! \brief Build a Simulator object based on input data * * Return a pointer to a simulation object. The use of a parameter -- 2.11.4.GIT