Move shellfc code to the mdrun module
authorPrashanth Kanduri <kanduri@cscs.ch>
Fri, 29 Mar 2019 16:15:32 +0000 (17:15 +0100)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Wed, 17 Apr 2019 16:50:30 +0000 (18:50 +0200)
This code was previously in mdlib and made use of the force
calculation routines. The introduction of the forceschedules
module (Patch 9363) introduces a cyclic dependency.

Therefore, this clean up is important to ensure that all
users of the Force Schedules are present in a single module.

Related: #2574, #2774

Change-Id: I19563f0f6e7985d198a2497a799c5377b24a1419

src/gromacs/domdec/mdsetup.cpp [moved from src/gromacs/mdlib/mdsetup.cpp with 99% similarity]
src/gromacs/domdec/mdsetup.h [moved from src/gromacs/mdlib/mdsetup.h with 86% similarity]
src/gromacs/domdec/partition.cpp
src/gromacs/mdrun/CMakeLists.txt
src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/mimic.cpp
src/gromacs/mdrun/minimize.cpp
src/gromacs/mdrun/rerun.cpp
src/gromacs/mdrun/shellfc.cpp [moved from src/gromacs/mdlib/shellfc.cpp with 99% similarity]
src/gromacs/mdrun/shellfc.h [moved from src/gromacs/mdlib/shellfc.h with 96% similarity]

similarity index 99%
rename from src/gromacs/mdlib/mdsetup.cpp
rename to src/gromacs/domdec/mdsetup.cpp
index c3dffae4f52497616160f201db2b45d8cfdb73fb..b1457a2240455bd12e0d62e2d5e736ceec65e021 100644 (file)
@@ -42,7 +42,6 @@
 #include "gromacs/listed_forces/manage_threading.h"
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/mdatoms.h"
-#include "gromacs/mdlib/shellfc.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/forcerec.h"
similarity index 86%
rename from src/gromacs/mdlib/mdsetup.h
rename to src/gromacs/domdec/mdsetup.h
index 195905169156caa8f7ba249973146aadca593205..ab8cd0110c602cd5bbf4b0d64ca4c70d6d47eab9 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifndef GMX_MDLIB_MDSETUP_H
-#define GMX_MDLIB_MDSETUP_H
+
+/*! \libinternal \file
+ * \brief Contains functions relevant to simulation setup in MD drivers
+ *
+ * \inlibraryapi
+ * \ingroup module_domdec
+ */
+
+#ifndef GMX_DOMDEC_MDSETUP_H
+#define GMX_DOMDEC_MDSETUP_H
 
 struct bonded_threading_t;
 struct gmx_localtop_t;
@@ -44,6 +52,7 @@ struct t_commrec;
 struct t_forcerec;
 struct t_graph;
 struct t_inputrec;
+struct t_mdatoms;
 
 namespace gmx
 {
@@ -51,6 +60,16 @@ class Constraints;
 class MDAtoms;
 }
 
+/*! \brief Gets the local shell with domain decomposition
+ *
+ * \param[in]     cr        Communication record
+ * \param[in]     md        The MD atom data
+ * \param[in,out] shfc      The shell/flexible-constraint data
+ */
+void make_local_shells(const t_commrec *cr,
+                       const t_mdatoms *md,
+                       gmx_shellfc_t   *shfc);
+
 /*! \brief Sets atom data for several MD algorithms
  *
  * Most MD algorithms require two different setup calls:
index 789804bf756ad458f04d60cd21bcab3229decaa1..08e8b0f607984cba84981bc200865cd16bc59f1c 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/domdec/domdec_network.h"
 #include "gromacs/domdec/ga2la.h"
 #include "gromacs/domdec/localatomsetmanager.h"
+#include "gromacs/domdec/mdsetup.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/gmxlib/chargegroup.h"
 #include "gromacs/gmxlib/network.h"
@@ -69,7 +70,6 @@
 #include "gromacs/mdlib/forcerec.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/mdatoms.h"
-#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/nsgrid.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/commrec.h"
index e9073906d6439f9619507d39c1fb268fba692778..11d361592d8c7e30ed0314673b670b576307243b 100644 (file)
@@ -36,6 +36,7 @@ gmx_add_libgromacs_sources(
     integrator.cpp
     legacymdrunoptions.cpp
     logging.cpp
+    shellfc.cpp
     md.cpp
     mdmodules.cpp
     minimize.cpp
index 6ced9b298562f662d07cc7ae713b1bf45ae9c501..674cdb4871cd2dde49cf435b68545a1357247646 100644 (file)
@@ -58,6 +58,7 @@
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_network.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/domdec/mdsetup.h"
 #include "gromacs/domdec/partition.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdoutf.h"
-#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/resethandler.h"
-#include "gromacs/mdlib/shellfc.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/simulationsignal.h"
 #include "gromacs/mdlib/stat.h"
 
 #include "integrator.h"
 #include "replicaexchange.h"
+#include "shellfc.h"
 
 #if GMX_FAHCORE
 #include "corewrap.h"
index 0f83389c321ca449ab4bb7e1ef07210910011106..af1f5e0734cbfc66dd1dc80aa092bda409f0c778 100644 (file)
@@ -57,6 +57,7 @@
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_network.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/domdec/mdsetup.h"
 #include "gromacs/domdec/partition.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdoutf.h"
-#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/resethandler.h"
-#include "gromacs/mdlib/shellfc.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/simulationsignal.h"
 #include "gromacs/mdlib/stat.h"
 
 #include "integrator.h"
 #include "replicaexchange.h"
+#include "shellfc.h"
 
 using gmx::SimulationSignaller;
 
index 1b7a87a5ca02bbcd9ef82766973b181d6bb01511..fbacf87cf6f63c8f34c85ceacae6c5a3c8d05e15 100644 (file)
@@ -58,6 +58,7 @@
 #include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/domdec/mdsetup.h"
 #include "gromacs/domdec/partition.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/fileio/confio.h"
@@ -79,9 +80,7 @@
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
-#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/ns.h"
-#include "gromacs/mdlib/shellfc.h"
 #include "gromacs/mdlib/stat.h"
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdlib/trajectory_writing.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "integrator.h"
+#include "shellfc.h"
 
 //! Utility structure for manipulating states during EM
 typedef struct {
index 4ba7730be85cce9ae7a9908e3f388fb1b88b282c..9bc7d9dfc088cfd708d6c119d656dc2a5dfc6472 100644 (file)
@@ -58,6 +58,7 @@
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_network.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/domdec/mdsetup.h"
 #include "gromacs/domdec/partition.h"
 #include "gromacs/essentialdynamics/edsam.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdoutf.h"
-#include "gromacs/mdlib/mdsetup.h"
 #include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/resethandler.h"
-#include "gromacs/mdlib/shellfc.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/simulationsignal.h"
 #include "gromacs/mdlib/stat.h"
 
 #include "integrator.h"
 #include "replicaexchange.h"
+#include "shellfc.h"
 
 using gmx::SimulationSignaller;
 
similarity index 99%
rename from src/gromacs/mdlib/shellfc.cpp
rename to src/gromacs/mdrun/shellfc.cpp
index 74d17c822a675d3eada5f3352b6dd5f3c43ec852..1e08fda683a744d0e724584c262d0e2c0a8c56a9 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/domdec/dlbtiming.h"
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/domdec/mdsetup.h"
 #include "gromacs/gmxlib/chargegroup.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/functions.h"
similarity index 96%
rename from src/gromacs/mdlib/shellfc.h
rename to src/gromacs/mdrun/shellfc.h
index 1842314e40ffd4838997c58bf2e2b4e0c7ab670e..3d847b04ad4c2181d37a806a276e36504a0a44d2 100644 (file)
@@ -69,11 +69,6 @@ gmx_shellfc_t *init_shell_flexcon(FILE *fplog,
                                   int nstcalcenergy,
                                   bool usingDomainDecomposition);
 
-/* Get the local shell with domain decomposition */
-void make_local_shells(const t_commrec *cr,
-                       const t_mdatoms *md,
-                       gmx_shellfc_t   *shfc);
-
 /* Optimize shell positions */
 void relax_shell_flexcon(FILE                                     *log,
                          const t_commrec                          *cr,