Move some mdrun code out of gmxlib/
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 13 Dec 2015 10:20:21 +0000 (12:20 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Dec 2015 02:15:39 +0000 (03:15 +0100)
- Move sighandler.* to mdlib, since it is specific to mdrun.
- Move thread_affinity.* to mdrunutility, since it is only used from
  runner.cpp.  Convert existing comments to rudimentary Doxygen
  documentation to avoid check-source and Doxygen warnings.

Change-Id: I83d431497480bcfa2b2edf8f347708a0c1832005

src/gromacs/ewald/pme-pp.cpp
src/gromacs/imd/imd.cpp
src/gromacs/mdlib/sighandler.cpp [moved from src/gromacs/gmxlib/sighandler.cpp with 99% similarity]
src/gromacs/mdlib/sighandler.h [moved from src/gromacs/gmxlib/sighandler.h with 97% similarity]
src/gromacs/mdrunutility/threadaffinity.cpp [moved from src/gromacs/gmxlib/thread_affinity.cpp with 99% similarity]
src/gromacs/mdrunutility/threadaffinity.h [moved from src/gromacs/gmxlib/thread_affinity.h with 86% similarity]
src/programs/mdrun/md.cpp
src/programs/mdrun/runner.cpp

index 970945b8098fad531a1dac499bee35cf79959cce..da19dd86bef21fdac447faae17543ca43b8bc1ea 100644 (file)
@@ -56,8 +56,8 @@
 #include "gromacs/domdec/domdec_struct.h"
 #include "gromacs/ewald/pme.h"
 #include "gromacs/gmxlib/network.h"
-#include "gromacs/gmxlib/sighandler.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/utility/fatalerror.h"
index 6d565ca8a76f5eed3686717dc19b9b100001aee9..e5e822898379e8e62ece32c7daa2258e4c29bc5d 100644 (file)
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxlib/network.h"
-#include "gromacs/gmxlib/sighandler.h"
 #include "gromacs/imd/imdsocket.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/mdlib/mdrun.h"
+#include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
similarity index 99%
rename from src/gromacs/gmxlib/sighandler.cpp
rename to src/gromacs/mdlib/sighandler.cpp
index bbd593ce9c6a105a787a7f2fa87b53191454cf78..1db70fec3fb9d48851aac25296ccbd745da0b63f 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "config.h"
 
+#include <csignal>
 #include <cstdlib>
 
 #include "gromacs/utility/fatalerror.h"
similarity index 97%
rename from src/gromacs/gmxlib/sighandler.h
rename to src/gromacs/mdlib/sighandler.h
index 20d501a33c6d4b710f032e0e0017502e8956cf20..233399049bd1787d849ff1207e63f7739f8dc017 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_GMXLIB_SIGHANDLER_H
-#define GMX_GMXLIB_SIGHANDLER_H
-
-#include <signal.h>
+#ifndef GMX_MDLIB_SIGHANDLER_H
+#define GMX_MDLIB_SIGHANDLER_H
 
 #include "gromacs/utility/basedefinitions.h"
 
similarity index 99%
rename from src/gromacs/gmxlib/thread_affinity.cpp
rename to src/gromacs/mdrunutility/threadaffinity.cpp
index c55f024ab10749076a592df594eb54e487587880..aabe94144d873af75a7a0676b62d47263e9cee4a 100644 (file)
@@ -34,7 +34,7 @@
  */
 #include "gmxpre.h"
 
-#include "thread_affinity.h"
+#include "threadaffinity.h"
 
 #include "config.h"
 
similarity index 86%
rename from src/gromacs/gmxlib/thread_affinity.h
rename to src/gromacs/mdrunutility/threadaffinity.h
index 7a77ff0f7465bb90e569d1b557a9ae4468e7684b..8ca8854bf2d35f08c4b5e939a3cc2e98d0394c7b 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_GMXLIB_THREAD_AFFINITY_H
-#define GMX_GMXLIB_THREAD_AFFINITY_H
+/*! \libinternal \file
+ * \brief
+ * Declares functions for managing mdrun thread affinity.
+ *
+ * \inlibraryapi
+ * \ingroup module_mdrunutility
+ */
+#ifndef GMX_MDRUNUTILITY_THREADAFFINITY_H
+#define GMX_MDRUNUTILITY_THREADAFFINITY_H
 
 #include <cstdio>
 
 
 struct t_commrec;
 
-/* Sets the thread affinity using the requested setting stored in hw_opt.
- * The hardware topologu is requested from hwinfo, when present.
+/*! \brief
+ * Sets the thread affinity using the requested setting stored in hw_opt.
+ *
+ * The hardware topology is requested from hwinfo, when present.
  */
 void
 gmx_set_thread_affinity(FILE                *fplog,
@@ -51,8 +60,10 @@ gmx_set_thread_affinity(FILE                *fplog,
                         const gmx_hw_opt_t  *hw_opt,
                         const gmx_hw_info_t *hwinfo);
 
-/* Check the process affinity mask and if it is found to be non-zero,
+/*! \brief
+ * Checks the process affinity mask and if it is found to be non-zero,
  * will honor it and disable mdrun internal affinity setting.
+ *
  * This function should be called first before the OpenMP library gets
  * initialized with the last argument FALSE (which will detect affinity
  * set by external tools like taskset), and later, after the OpenMP
index 993aad132680b7a72bf64ac26cf4a4c56f5e9ec8..4b152333adea46edc57dd3d525ac6115bfac959c 100644 (file)
@@ -56,7 +56,6 @@
 #include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/gmxlib/nrnb.h"
-#include "gromacs/gmxlib/sighandler.h"
 #include "gromacs/imd/imd.h"
 #include "gromacs/listed-forces/manage-threading.h"
 #include "gromacs/math/utilities.h"
@@ -78,6 +77,7 @@
 #include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/shellfc.h"
+#include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdlib/trajectory_writing.h"
index d42348401945999584845ab0e87f8c1f94d19598..7d240d248c6586bef53ff790d0c7f7d59dc64eed 100644 (file)
@@ -67,8 +67,6 @@
 #include "gromacs/gmxlib/main.h"
 #include "gromacs/gmxlib/md_logging.h"
 #include "gromacs/gmxlib/network.h"
-#include "gromacs/gmxlib/sighandler.h"
-#include "gromacs/gmxlib/thread_affinity.h"
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/listed-forces/disre.h"
 #include "gromacs/listed-forces/orires.h"
@@ -85,7 +83,9 @@
 #include "gromacs/mdlib/minimize.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/qmmm.h"
+#include "gromacs/mdlib/sighandler.h"
 #include "gromacs/mdlib/tpi.h"
+#include "gromacs/mdrunutility/threadaffinity.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/state.h"