Use ReplicaExchange member instead of build() argument.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Thu, 23 Apr 2020 15:03:05 +0000 (18:03 +0300)
committerJoe Jordan <ejjordan12@gmail.com>
Fri, 26 Jun 2020 10:54:08 +0000 (10:54 +0000)
Refs #3567

src/gromacs/mdrun/runner.cpp
src/gromacs/mdrun/simulatorbuilder.cpp
src/gromacs/mdrun/simulatorbuilder.h

index b07bd3f39ee40608f554c1730b2af6fd16e610b6..7e29b9c8cb1454b7f8e29142f2c3c362ef90b5dd 100644 (file)
@@ -1656,7 +1656,7 @@ int Mdrunner::mdrunner()
 
         // build and run simulator object based on user-input
         auto simulator = simulatorBuilder.build(useModularSimulator, deform.get(), pull_work, swap,
-                                                &mtop, mdAtoms.get(), replExParams);
+                                                &mtop, mdAtoms.get());
         simulator->run();
 
         if (fr->pmePpCommGpu)
index 3c623777913bd029866496dd2ce85d6cb3aeef16..519bf96144e3046fe50ed782960d575374d5cb14 100644 (file)
@@ -61,8 +61,7 @@ std::unique_ptr<ISimulator> SimulatorBuilder::build(bool            useModularSi
                                                     pull_t*         pull_work,
                                                     t_swap*         swap,
                                                     gmx_mtop_t*     top_global,
-                                                    MDAtoms*        mdAtoms,
-                                                    const ReplicaExchangeParameters& replExParams)
+                                                    MDAtoms*        mdAtoms)
 {
     // TODO: Reduce protocol complexity.
     //     Investigate individual paramters. Identify default-constructable parameters and clarify
@@ -137,8 +136,8 @@ std::unique_ptr<ISimulator> SimulatorBuilder::build(bool            useModularSi
                 pull_work, swap, top_global, simulatorStateData_->globalState_p,
                 simulatorStateData_->observablesHistory_p, mdAtoms, profiling_->nrnb,
                 profiling_->wallCycle, legacyInput_->forceRec, simulatorStateData_->enerdata_p,
-                simulatorStateData_->ekindata_p, simulatorConfig_->runScheduleWork_, replExParams,
-                membedHolder_->membed(), profiling_->walltimeAccounting,
+                simulatorStateData_->ekindata_p, simulatorConfig_->runScheduleWork_,
+                *replicaExchangeParameters_, membedHolder_->membed(), profiling_->walltimeAccounting,
                 std::move(stopHandlerBuilder_), simulatorConfig_->mdrunOptions_.rerun));
     }
     // NOLINTNEXTLINE(modernize-make-unique): make_unique does not work with private constructor
@@ -152,8 +151,8 @@ std::unique_ptr<ISimulator> SimulatorBuilder::build(bool            useModularSi
             swap, top_global, simulatorStateData_->globalState_p,
             simulatorStateData_->observablesHistory_p, mdAtoms, profiling_->nrnb,
             profiling_->wallCycle, legacyInput_->forceRec, simulatorStateData_->enerdata_p,
-            simulatorStateData_->ekindata_p, simulatorConfig_->runScheduleWork_, replExParams,
-            membedHolder_->membed(), profiling_->walltimeAccounting,
+            simulatorStateData_->ekindata_p, simulatorConfig_->runScheduleWork_,
+            *replicaExchangeParameters_, membedHolder_->membed(), profiling_->walltimeAccounting,
             std::move(stopHandlerBuilder_), simulatorConfig_->mdrunOptions_.rerun));
 }
 
index f94f7904e9eebe6824151b2e7002367f3d27d1a4..f158267a6903a4667733d76b1dcf41488ca1d186 100644 (file)
@@ -325,13 +325,12 @@ public:
      *
      * \return  Unique pointer to a Simulator object
      */
-    std::unique_ptr<ISimulator> build(bool                             useModularSimulator,
-                                      BoxDeformation*                  deform,
-                                      pull_t*                          pull_work,
-                                      t_swap*                          swap,
-                                      gmx_mtop_t*                      top_global,
-                                      MDAtoms*                         mdAtoms,
-                                      const ReplicaExchangeParameters& replExParams);
+    std::unique_ptr<ISimulator> build(bool            useModularSimulator,
+                                      BoxDeformation* deform,
+                                      pull_t*         pull_work,
+                                      t_swap*         swap,
+                                      gmx_mtop_t*     top_global,
+                                      MDAtoms*        mdAtoms);
 
 private:
     // Note: we use std::unique_ptr instead of std::optional because we want to