Sort includes outside src/gromacs
[alexxy/gromacs.git] / src / programs / mdrun / tests / moduletest.cpp
index 46c9a446aadc8e4041590a62a8569e02e869a860..b9cb26f3549fc99a00f073e3091b3810c0867655 100644 (file)
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun
  */
+#include "gmxpre.h"
+
 #include "moduletest.h"
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
+#include "config.h"
 
-#include "testutils/integrationtests.h"
-#include "testutils/testoptions.h"
-#include "testutils/cmdlinetest.h"
-#include "gromacs/options/options.h"
+#include "gromacs/gmxpreprocess/grompp.h"
 #include "gromacs/options/basicoptions.h"
+#include "gromacs/options/options.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/file.h"
-#include "gromacs/legacyheaders/network.h"
-#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/gmxpreprocess/grompp.h"
 #include "programs/mdrun/mdrun_main.h"
 
+#include "testutils/cmdlinetest.h"
+#include "testutils/integrationtests.h"
+#include "testutils/testoptions.h"
+
 namespace gmx
 {
 namespace test
@@ -68,11 +69,14 @@ namespace test
 namespace
 {
 
+#if defined(GMX_THREAD_MPI) || defined(DOXYGEN)
 //! Number of tMPI threads for child mdrun call.
-int gmx_unused g_numThreads = 1;
+int g_numThreads = 1;
+#endif
+#if defined(GMX_OPENMP) || defined(DOXYGEN)
 //! Number of OpenMP threads for child mdrun call.
-int gmx_unused g_numOpenMPThreads = 1;
-
+int g_numOpenMPThreads = 1;
+#endif
 //! \cond
 GMX_TEST_OPTIONS(MdrunTestOptions, options)
 {
@@ -148,16 +152,8 @@ MdrunTestFixture::useTopGroAndNdxFromDatabase(const char *name)
 }
 
 int
-MdrunTestFixture::callGrompp()
+MdrunTestFixture::callGromppOnThisRank()
 {
-#ifdef GMX_LIB_MPI
-    // When compiled with external MPI, only call one instance of the grompp function
-    if (0 != gmx_node_rank())
-    {
-        return 0;
-    }
-#endif
-
     CommandLine caller;
     caller.append("grompp");
     caller.addOption("-f", mdpInputFileName);
@@ -171,6 +167,20 @@ MdrunTestFixture::callGrompp()
     return gmx_grompp(caller.argc(), caller.argv());
 }
 
+int
+MdrunTestFixture::callGrompp()
+{
+#ifdef GMX_LIB_MPI
+    // When compiled with external MPI, only call one instance of the
+    // grompp function
+    if (0 != gmx_node_rank())
+    {
+        return 0;
+    }
+#endif
+    return callGromppOnThisRank();
+}
+
 int
 MdrunTestFixture::callMdrun(const CommandLine &callerRef)
 {