Create gromacs/mdrun module and move code there
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 28 Feb 2018 14:54:26 +0000 (15:54 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 5 Apr 2018 17:28:54 +0000 (19:28 +0200)
Improving how we dispatch the work for do_md and friends requires that
they all compile as part of libgromacs (or all outside of it). The
code currently in src/programs/mdrun is there simply because it hasn't
been moved from the old src/kernel layout, rather than through any
clear design, so we should move it now that we have a reason.

Other code from src/programs/mdrun now needs to move into libgromacs
also, but we currently don't have a module for miscellanous mdrun
features, so we're adding to the abuse of mdlib for now.

Refs #1793
Refs #2423

Change-Id: I4f9ad5d0bf6585675472b49b2d5654f588b7214e

18 files changed:
docs/doxygen/suppressions.txt
src/gromacs/CMakeLists.txt
src/gromacs/mdlib/deform.h [moved from src/programs/mdrun/deform.h with 96% similarity]
src/gromacs/mdlib/membed.cpp [moved from src/programs/mdrun/membed.cpp with 100% similarity]
src/gromacs/mdlib/membed.h [moved from src/programs/mdrun/membed.h with 96% similarity]
src/gromacs/mdlib/repl_ex.cpp [moved from src/programs/mdrun/repl_ex.cpp with 100% similarity]
src/gromacs/mdlib/repl_ex.h [moved from src/programs/mdrun/repl_ex.h with 100% similarity]
src/gromacs/mdrun/CMakeLists.txt [new file with mode: 0644]
src/gromacs/mdrun/integrator.h [moved from src/gromacs/mdlib/integrator.h with 97% similarity]
src/gromacs/mdrun/md.cpp [moved from src/programs/mdrun/md.cpp with 99% similarity]
src/gromacs/mdrun/md.h [moved from src/programs/mdrun/md.h with 87% similarity]
src/gromacs/mdrun/minimize.cpp [moved from src/gromacs/mdlib/minimize.cpp with 99% similarity]
src/gromacs/mdrun/minimize.h [moved from src/gromacs/mdlib/minimize.h with 90% similarity]
src/gromacs/mdrun/runner.cpp [moved from src/programs/mdrun/runner.cpp with 99% similarity]
src/gromacs/mdrun/runner.h [moved from src/programs/mdrun/runner.h with 98% similarity]
src/gromacs/mdrun/tpi.cpp [moved from src/gromacs/mdlib/tpi.cpp with 99% similarity]
src/gromacs/mdrun/tpi.h [moved from src/gromacs/mdlib/tpi.h with 90% similarity]
src/programs/mdrun/mdrun.cpp

index 9e8b9c3c397f5a0e2ea96216d00b2e16f89a0d1b..3f157c5ca7e29379cfa6cb7dd5268eeba1e20c62 100644 (file)
@@ -27,10 +27,6 @@ src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h: warning:
 src/gromacs/mdlib/nbnxn_search_simd_2xnn.h: warning: should include "simd.h"
 src/gromacs/mdlib/nbnxn_search_simd_4xn.h: warning: should include "simd.h"
 
-# There's no decision yet on how to name and organize modules of functionality
-# specific to mdrun
-: error: no matching directory for module: module_mdrun
-
 # This module name doesn't really fall into any currently used pattern; needs some thought
 : error: no matching directory for module: module_mdrun_integration_tests
 
index bd23b141e59e751490d666282d5952eb834d8840..f4b6337bebd1cabbdd62178c87597cb661ee3fe6 100644 (file)
@@ -86,6 +86,7 @@ add_subdirectory(gpu_utils)
 add_subdirectory(hardware)
 add_subdirectory(linearalgebra)
 add_subdirectory(math)
+add_subdirectory(mdrun)
 add_subdirectory(mdrunutility)
 add_subdirectory(mdtypes)
 add_subdirectory(onlinehelp)
similarity index 96%
rename from src/programs/mdrun/deform.h
rename to src/gromacs/mdlib/deform.h
index c51e29ab5f4b844169618490f6f5819a4e88fac3..f4d0425b6a4ec929ff6f36f6987774a2c9b2e6c6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
similarity index 96%
rename from src/programs/mdrun/membed.h
rename to src/gromacs/mdlib/membed.h
index 9f754fa9ae5d94afaefdc2ba4647258ea8bf2b39..8316323df9c924b0ca4a014627bd97ea738de44e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
diff --git a/src/gromacs/mdrun/CMakeLists.txt b/src/gromacs/mdrun/CMakeLists.txt
new file mode 100644 (file)
index 0000000..0654e1c
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2018, by the GROMACS development team, led by
+# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+# and including many others, as listed in the AUTHORS file in the
+# top-level source directory and at http://www.gromacs.org.
+#
+# GROMACS is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation; either version 2.1
+# of the License, or (at your option) any later version.
+#
+# GROMACS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with GROMACS; if not, see
+# http://www.gnu.org/licenses, or write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+#
+# If you want to redistribute modifications to GROMACS, please
+# consider that scientific software is very special. Version
+# control is crucial - bugs must be traceable. We will be happy to
+# consider code for inclusion in the official distribution, but
+# derived work must not be called official GROMACS. Details are found
+# in the README & COPYING files - if they are missing, get the
+# official version at http://www.gromacs.org.
+#
+# To help us fund GROMACS development, we humbly ask that you cite
+# the research papers on the package. Check out http://www.gromacs.org.
+
+gmx_add_libgromacs_sources(
+    md.cpp
+    minimize.cpp
+    runner.cpp
+    tpi.cpp
+    )
+
+if (BUILD_TESTING)
+# TODO import this from src/programs/mdrun/tests
+#    add_subdirectory(tests)
+endif()
similarity index 97%
rename from src/gromacs/mdlib/integrator.h
rename to src/gromacs/mdrun/integrator.h
index 5def900acb4d3c60db7f4e5fd7eb83ca39e6d1c7..d5be82141025bd242304638ae9f6e1470c0c0900 100644 (file)
 /*! \brief Declares the integrator type for mdrun
  *
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
-#ifndef GMX_MDLIB_INTEGRATOR_H
-#define GMX_MDLIB_INTEGRATOR_H
+#ifndef GMX_MDRUN_INTEGRATOR_H
+#define GMX_MDRUN_INTEGRATOR_H
 
 #include <cstdio>
 
@@ -119,4 +119,4 @@ typedef double integrator_t (FILE *fplog, t_commrec *cr,
 
 }      // namespace gmx
 
-#endif // GMX_MDLIB_INTEGRATOR_H
+#endif // GMX_MDRUN_INTEGRATOR_H
similarity index 99%
rename from src/programs/mdrun/md.cpp
rename to src/gromacs/mdrun/md.cpp
index 245443ef9593c7971f4d8a6153bfaa2a161f75bc..4751be45d3c742995f0704e6753606fedc7eca4c 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.
  */
+/*! \internal \file
+ *
+ * \brief Implements the integrator for normal molecular dynamics simulations
+ *
+ * \author David van der Spoel <david.vanderspoel@icm.uu.se>
+ * \ingroup module_mdrun
+ */
 #include "gmxpre.h"
 
 #include "md.h"
@@ -71,6 +78,7 @@
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/compute_io.h"
 #include "gromacs/mdlib/constr.h"
+#include "gromacs/mdlib/deform.h"
 #include "gromacs/mdlib/ebin.h"
 #include "gromacs/mdlib/expanded.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/mdoutf.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/mdsetup.h"
+#include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
 #include "gromacs/mdlib/ns.h"
+#include "gromacs/mdlib/repl_ex.h"
 #include "gromacs/mdlib/shellfc.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
-#include "deform.h"
-#include "membed.h"
-#include "repl_ex.h"
-
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
 #endif
 
 using gmx::SimulationSignaller;
 
+//! Resets all the counters.
 static void reset_all_counters(FILE *fplog, const gmx::MDLogger &mdlog, t_commrec *cr,
                                gmx_int64_t step,
                                gmx_int64_t *step_rel, t_inputrec *ir,
similarity index 87%
rename from src/programs/mdrun/md.h
rename to src/gromacs/mdrun/md.h
index 8e5d77f135c5f27d6136bea5c8ac7f029a4ddccb..efa96873277c3d9e338d877ea95fbfebc98d2245 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  */
 /*! \internal \file
  *
- * \brief Declares the integrators for molecular dynamics simulations
+ * \brief Declares the integrator for normal molecular dynamics simulations
  *
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
-#ifndef GMX_MDLIB_MD_H
-#define GMX_MDLIB_MD_H
+#ifndef GMX_MDRUN_MD_H
+#define GMX_MDRUN_MD_H
 
-#include "gromacs/mdlib/integrator.h"
+#include "integrator.h"
 
 namespace gmx
 {
@@ -52,4 +52,4 @@ integrator_t do_md;
 
 }      // namespace gmx
 
-#endif // GMX_MDLIB_MD_H
+#endif // GMX_MDRUN_MD_H
similarity index 99%
rename from src/gromacs/mdlib/minimize.cpp
rename to src/gromacs/mdrun/minimize.cpp
index 3c30f22e77a706559e8bed291bc1cc59ba97f67b..e18f673949e3edc574366b7dce57dee3a1cdcaf0 100644 (file)
@@ -40,7 +40,7 @@
  *
  * \author Berk Hess <hess@kth.se>
  * \author Erik Lindahl <erik@kth.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
 #include "gmxpre.h"
 
similarity index 90%
rename from src/gromacs/mdlib/minimize.h
rename to src/gromacs/mdrun/minimize.h
index 055fe770735e900a2fac75eb9f268c651c5d42a4..00ed45ffd761b9b99012477e25752b1de048a5a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*! \brief Declares the integrators for energy minimization and NMA
  *
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
-#ifndef GMX_MDLIB_MINIMIZE_H
-#define GMX_MDLIB_MINIMIZE_H
+#ifndef GMX_MDRUN_MINIMIZE_H
+#define GMX_MDRUN_MINIMIZE_H
 
-#include "gromacs/mdlib/integrator.h"
+#include "integrator.h"
 
 namespace gmx
 {
@@ -59,4 +59,4 @@ integrator_t do_nm;
 
 }      // namespace gmx
 
-#endif // GMX_MDLIB_MINIMIZE_H
+#endif // GMX_MDRUN_MINIMIZE_H
similarity index 99%
rename from src/programs/mdrun/runner.cpp
rename to src/gromacs/mdrun/runner.cpp
index 61410e91e35d8367e360bae453866750f2a447fd..a35a94d96cd3a89dbe76cdb78e1b370fa187d9f9 100644 (file)
@@ -39,7 +39,7 @@
  * \brief Implements the MD runner routine calling all integrators.
  *
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
 #include "gmxpre.h"
 
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/calc_verletbuf.h"
 #include "gromacs/mdlib/constr.h"
+#include "gromacs/mdlib/deform.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/forcerec.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
-#include "gromacs/mdlib/integrator.h"
 #include "gromacs/mdlib/main.h"
 #include "gromacs/mdlib/md_support.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdrun.h"
-#include "gromacs/mdlib/minimize.h"
+#include "gromacs/mdlib/membed.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/nbnxn_tuning.h"
 #include "gromacs/mdlib/qmmm.h"
+#include "gromacs/mdlib/repl_ex.h"
 #include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
-#include "gromacs/mdlib/tpi.h"
 #include "gromacs/mdrunutility/mdmodules.h"
 #include "gromacs/mdrunutility/threadaffinity.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/smalloc.h"
 #include "gromacs/utility/stringutil.h"
 
-#include "deform.h"
+#include "integrator.h"
 #include "md.h"
-#include "membed.h"
-#include "repl_ex.h"
+#include "minimize.h"
+#include "tpi.h"
 
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
similarity index 98%
rename from src/programs/mdrun/runner.h
rename to src/gromacs/mdrun/runner.h
index 2c458f0844e932635bced917692aa2cd80e8e42b..2789ff9500dd9d5f5efaf948f72ce77a87dfcf84 100644 (file)
  * \brief Declares the routine running the inetgrators.
  *
  * \author David van der Spoel <david.vanderspoel@icm.uu.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
-#ifndef GMX_MDLIB_RUNNER_H
-#define GMX_MDLIB_RUNNER_H
+#ifndef GMX_MDRUN_RUNNER_H
+#define GMX_MDRUN_RUNNER_H
 
 #include <cstdio>
 
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/repl_ex.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-#include "repl_ex.h"
-
 struct gmx_output_env_t;
 struct ReplicaExchangeParameters;
 struct t_commrec;
@@ -180,4 +179,4 @@ class Mdrunner
 
 }      // namespace gmx
 
-#endif // GMX_MDLIB_RUNNER_H
+#endif // GMX_MDRUN_RUNNER_H
similarity index 99%
rename from src/gromacs/mdlib/tpi.cpp
rename to src/gromacs/mdrun/tpi.cpp
index bf25ece3882365159419203bef1c6697d0f74c5f..54a202f500466d88953266a5eda94f6664f05a4d 100644 (file)
@@ -39,7 +39,7 @@
  * \brief This file defines the integrator for test particle insertion
  *
  * \author Berk Hess <hess@kth.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrun
  */
 #include "gmxpre.h"
 
similarity index 90%
rename from src/gromacs/mdlib/tpi.h
rename to src/gromacs/mdrun/tpi.h
index 67f1c6f81fccf7f8f030e0a268f205d34c9b6556..97b428f57b14660aa94690ae8565aceff6ca9c3f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /*! \brief Declares the integrator for test particle insertion
  *
  * \author Berk Hess <hess@kth.se>
- * \ingroup module_mdlib
+ * \ingroup module_mdrunx
  */
-#ifndef GMX_MDLIB_TPI_H
-#define GMX_MDLIB_TPI_H
+#ifndef GMX_MDRUN_TPI_H
+#define GMX_MDRUN_TPI_H
 
-#include "gromacs/mdlib/integrator.h"
+#include "integrator.h"
 
 namespace gmx
 {
@@ -50,4 +50,4 @@ integrator_t do_tpi;
 
 }      // namespace gmx
 
-#endif // GMX_MDLIB_TPI_H
+#endif // GMX_MDRUN_TPI_H
index efae59180c6f4b18dedbfbc181b553ba8b770d70..8a5c3278a2575e9ea1ca648ce2589f18640ac36a 100644 (file)
@@ -64,6 +64,8 @@
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/mdlib/main.h"
 #include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/repl_ex.h"
+#include "gromacs/mdrun/runner.h"
 #include "gromacs/mdrunutility/handlerestart.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/arraysize.h"
@@ -71,8 +73,6 @@
 #include "gromacs/utility/smalloc.h"
 
 #include "mdrun_main.h"
-#include "repl_ex.h"
-#include "runner.h"
 
 /*! \brief Return whether the command-line parameter that
  *  will trigger a multi-simulation is set */