Used IWYU to partially clean up some includes
authorRoland Schulz <roland@utk.edu>
Fri, 30 May 2014 05:02:23 +0000 (01:02 -0400)
committerRoland Schulz <roland@utk.edu>
Mon, 20 Oct 2014 03:25:10 +0000 (23:25 -0400)
- Used trunk version
- Works well for C and simple C++ files
  - Does not yet work without manual reverting some changes for more complicated
     files e.g. options.cpp (see issues 105, 111, 135, and 138)
- IWYU doesn't check for conditional compiled code. I ran for
  pme.c and wallcycle.c with -DDEBUG_PME/_WCYCLE

Given that one needs to fix a few issues and have to check for #ifdefs it is
still manual work, but I think quite a bit faster and more complete than doing
it manually.

Change-Id: I7c5569693a4b84f481f0f7afd85f0f01c33295cf

25 files changed:
admin/iwyu.imp [new file with mode: 0644]
admin/iwyu.sh [new file with mode: 0755]
src/gromacs/ewald/pme.c
src/gromacs/ewald/pme.h
src/gromacs/legacyheaders/domdec.h
src/gromacs/legacyheaders/types/commrec.h
src/gromacs/legacyheaders/types/fcdata.h
src/gromacs/legacyheaders/types/forcerec.h
src/gromacs/legacyheaders/types/genborn.h
src/gromacs/legacyheaders/types/group.h
src/gromacs/math/do_fit.c
src/gromacs/math/do_fit.h
src/gromacs/mdlib/domdec.cpp
src/gromacs/mdlib/nbnxn_pairlist.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256.h
src/gromacs/timing/wallcycle.c
src/gromacs/topology/atomprop.cpp
src/gromacs/topology/mtop_util.c
src/gromacs/utility/basedefinitions.h
src/gromacs/utility/basenetwork.cpp
src/gromacs/utility/fatalerror.cpp
src/gromacs/utility/gmxmpi.h
src/gromacs/utility/uniqueptr.h
src/programs/mdrun/deform.h
src/programs/mdrun/md.cpp

diff --git a/admin/iwyu.imp b/admin/iwyu.imp
new file mode 100644 (file)
index 0000000..2c33b8c
--- /dev/null
@@ -0,0 +1,13 @@
+[
+{ include: ["<boost/smart_ptr/shared_ptr.hpp>", "private", "<boost/shared_ptr.hpp>", "public"] },
+{ include: ["<xmmintrin.h>", "public", "<emmintrin.h>", "public"] },
+{ include: ["<emmintrin.h>", "public", "<pmmintrin.h>", "public"] },
+{ include: ["<pmmintrin.h>", "public", "<smmintrin.h>", "public"] },
+{ include: ["<smmintrin.h>", "public", "<immintrin.h>", "public"] },
+{ include: ["<avxintrin.h>", "private", "<immintrin.h>", "public"] },
+{ include: ['"mpi.h"', "private", '"gromacs/utility/gmxmpi.h"', "public"] },
+{ include: ['"thread_mpi/atomic/gcc_x86.h"', "private", '"thread_mpi/atomic.h"', "public"] },
+{ include: ['<immintrin.h>', "public", '"gromacs/simd/simd.h"', "public"] },
+{ include: ['"gromacs/simd/impl_x86_avx_256/impl_x86_avx_256.h"', "private", '"gromacs/simd/simd.h"', "public"] },
+{ symbol: ["M_SQRT2", "private", '"gromacs/math/utilities.h"', "public"] }
+]
\ No newline at end of file
diff --git a/admin/iwyu.sh b/admin/iwyu.sh
new file mode 100755 (executable)
index 0000000..3d2fce6
--- /dev/null
@@ -0,0 +1,108 @@
+#!/bin/bash
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, 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.
+
+# The build and source folder can be specified with -B and -S respectively.
+# By default it assume "-B. -S..".
+# include-what-you-use needs to be in the path. Add --apply if you want
+# changes to be applied.  Any extra arguments are added as is to the
+# command (can be used for extra defines or include paths).
+
+filename=
+build_path=.
+src_path=..
+cmd="include-what-you-use -DHAVE_CONFIG_H -mavx"
+
+# Read all special arguments and add others to the command
+apply=0
+for arg in "$@"; do
+    if [ $arg == "--apply" ]; then
+       apply=1
+    elif [[ $arg == -[SB] ]]; then
+       echo -S and -B require an argument
+       exit 1
+    elif [[ $arg == -B* ]]; then
+       build_path=${arg:2}
+    elif [[ $arg == -S* ]]; then
+       src_path=${arg:2}
+    elif [[ $arg != -* ]]; then
+       if [ "$filename" == "" ]; then
+           filename=$arg
+       else
+           echo "This script can only be run on one file at a time"
+           exit 1
+       fi
+    else
+       cmd="$cmd $arg"
+    fi
+done
+
+if [ "$filename" == "" ]; then
+    echo "No file specified"
+    exit 1
+fi
+
+# We cannot detect wether it is a C++ or C header. Should be fine to always use C++
+if [ "${filename##*.}" == "h" ]; then
+    cmd="$cmd -x c++"
+fi
+
+cmd="$cmd $filename"
+
+# Always use C++11.
+if [ "${filename##*.}" == "cpp" -o "${filename##*.}" == "h" ]; then
+    cmd="$cmd -std=c++11"
+fi
+
+# keep gmxpre.h for source files
+if [ "${filename##*.}" == "cpp" -o "${filename##*.}" == "c" ]; then
+    cmd="$cmd  -Xiwyu --pch_in_code -Xiwyu --prefix_header_includes=keep"
+fi
+
+if [ $src_path == "." ]; then
+    src_folder="src" # ./src confuses IWYU
+else
+    src_folder="$src_path/src"
+fi
+
+cmd="$cmd -I${src_folder} -I${src_folder}/external/thread_mpi/include
+     -I$build_path/src -I${src_folder}/external/boost
+     -Xiwyu --mapping_file=${src_path}/admin/iwyu.imp"
+
+if [ $apply -eq 1 ] ; then
+    cmd="$cmd 2>&1 | fix_includes.py --nosafe_headers ||
+         ${src_path}/docs/doxygen/includesorter.py $filename -B$build_path -S$src_path"
+fi
+
+eval $cmd
index 76344ea75eb2e0a91ee4e31d78ee502834e7a06e..14a5c97135cc3f81a106a5534bd12d0cf62e7bf0 100644 (file)
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 
 #include "gromacs/ewald/pme-internal.h"
+#include "gromacs/fft/fft.h"
 #include "gromacs/fft/parallel_3dfft.h"
-#include "gromacs/fileio/pdbio.h"
 #include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/nrnb.h"
-#include "gromacs/legacyheaders/txtdump.h"
-#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
 #include "gromacs/math/gmxcomplex.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
+/* Include the SIMD macro file and then check for support */
+#include "gromacs/simd/simd.h"
+#include "gromacs/simd/simd_math.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
-/* Include the SIMD macro file and then check for support */
-#include "gromacs/simd/simd.h"
-#include "gromacs/simd/simd_math.h"
+#ifdef DEBUG_PME
+#include "gromacs/fileio/pdbio.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
+#endif
+
 #ifdef GMX_SIMD_HAVE_REAL
 /* Turn on arbitrary width SIMD intrinsics for PME solve */
 #    define PME_SIMD_SOLVE
@@ -1438,7 +1447,7 @@ static void spread_coefficients_bsplines_thread(pmegrid_t                    *pm
 #define PME_SPREAD_SIMD4_ALIGNED
 #define PME_ORDER 4
 #endif
-#include "gromacs/ewald/pme-simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_BSPLINE(4);
 #endif
@@ -1447,7 +1456,7 @@ static void spread_coefficients_bsplines_thread(pmegrid_t                    *pm
 #ifdef PME_SIMD4_SPREAD_GATHER
 #define PME_SPREAD_SIMD4_ALIGNED
 #define PME_ORDER 5
-#include "gromacs/ewald/pme-simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_BSPLINE(5);
 #endif
@@ -2601,7 +2610,7 @@ static void gather_f_bsplines(gmx_pme_t pme, real *grid,
 #define PME_GATHER_F_SIMD4_ALIGNED
 #define PME_ORDER 4
 #endif
-#include "gromacs/ewald/pme-simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_FSPLINE(4);
 #endif
@@ -2610,7 +2619,7 @@ static void gather_f_bsplines(gmx_pme_t pme, real *grid,
 #ifdef PME_SIMD4_SPREAD_GATHER
 #define PME_GATHER_F_SIMD4_ALIGNED
 #define PME_ORDER 5
-#include "gromacs/ewald/pme-simd4.h"
+#include "gromacs/ewald/pme-simd4.h" /* IWYU pragma: keep */
 #else
                     DO_FSPLINE(5);
 #endif
index f22341e10205e2a4cd5112608169e970129699f3..708626b36bb73640fb3ab492ef3ea449880ff184 100644 (file)
 
 #include <stdio.h>
 
-#include "gromacs/legacyheaders/network.h"
-#include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/math/gmxcomplex.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index c44c7bf8406784fdd4ee17326d357a3266c521d4..d8b9e6373f496f61380dd1793f73d448e94142c3 100644 (file)
 #ifndef _domdec_h
 #define _domdec_h
 
-#include "gromacs/legacyheaders/genborn.h"
-#include "gromacs/legacyheaders/typedefs.h"
+#include <stdio.h>
+
 #include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec_fwd.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 4486c847b6c9ee1923c96fe49c49600628132bba..cfc7669a2f1876d0bbd9b55985d4fe15c1ad97ea 100644 (file)
 #ifndef _commrec_h
 #define _commrec_h
 
-#include "gromacs/legacyheaders/typedefs.h"
+#include <stddef.h>
+
+#include "gromacs/legacyheaders/types/commrec_fwd.h" // IWYU pragma: export
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -268,12 +273,12 @@ struct t_commrec {
     gmx_nodecomm_t nc;
 
     /* For domain decomposition */
-    gmx_domdec_t *dd;
+    struct gmx_domdec_t *dd;
 
     /* The duties of this node, see the defines above */
-    int             duty;
+    int                    duty;
 
-    gmx_multisim_t *ms;
+    struct gmx_multisim_t *ms;
 
     /* these buffers are used as destination buffers if MPI_IN_PLACE isn't
        supported.*/
index 9188a3bb6ea74a6e4ef616e04f761dc1c62543b3..8e5498129f905af6906be6c34f56ab41ed9733b5 100644 (file)
@@ -42,6 +42,8 @@ extern "C" {
 #endif
 
 #include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 typedef real rvec5[5];
 
index f3f1302d5972ab4ed06a9533ea28a7aa6f6397b4..151c68af6d7cb83fa36fd4f2b48ea68440217829 100644 (file)
 #include "gromacs/legacyheaders/types/genborn.h"
 #include "gromacs/legacyheaders/types/hw_info.h"
 #include "gromacs/legacyheaders/types/interaction_const.h"
+#include "gromacs/legacyheaders/types/nblist.h"
 #include "gromacs/legacyheaders/types/ns.h"
 #include "gromacs/legacyheaders/types/qmmmrec.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/topology/idef.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index d7acafe0119ca7a66367b3669885cf5972b9f218..cfc9b4709ec39989469bae7037aaab7e515832df 100644 (file)
 #ifndef GMX_LEGACYHEADERS_TYPES_GENBORN_H
 #define GMX_LEGACYHEADERS_TYPES_GENBORN_H
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include "gromacs/legacyheaders/types/simple.h"
-
 typedef struct
 {
     int  nbonds;
index ea2fd293c70f1e5faa366764ae46dacdffabf9ca..1ad37bad7ffcc97a9a0f7ec39d829372ea975a1b 100644 (file)
@@ -37,7 +37,9 @@
 #ifndef GMX_LEGACYHEADERS_TYPES_GROUP_H
 #define GMX_LEGACYHEADERS_TYPES_GROUP_H
 
-#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 95d4b03fb698c6fbcdb03b428d9f1c3a960c9db9..ff2f71fa86ed52dbbf6373dd02190234b7b41a97 100644 (file)
@@ -38,6 +38,9 @@
 
 #include "do_fit.h"
 
+#include <math.h>
+#include <stdio.h>
+
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
index 7ccb652f19064e30d8cd37178eeb026dadddb403..526d4e33137584b121abe742c2c9b41d1bab235d 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "gromacs/legacyheaders/types/simple.h"
 #include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
index e3a05a5dd521200dda3cb2d3356cefaac81baf01..c1b2594bfdeef7c6250639cac81779f1ec67823c 100644 (file)
 #include "config.h"
 
 #include <assert.h>
+#include <limits.h>
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <time.h>
 
 #include <algorithm>
 
 #include "gromacs/legacyheaders/constr.h"
 #include "gromacs/legacyheaders/domdec_network.h"
 #include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/genborn.h"
 #include "gromacs/legacyheaders/gmx_ga2la.h"
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
 #include "gromacs/legacyheaders/gpu_utils.h"
-#include "gromacs/legacyheaders/macros.h"
 #include "gromacs/legacyheaders/mdatoms.h"
 #include "gromacs/legacyheaders/mdrun.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/nsgrid.h"
 #include "gromacs/legacyheaders/shellfc.h"
 #include "gromacs/legacyheaders/typedefs.h"
-#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/hw_info.h"
+#include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/ns.h"
+#include "gromacs/legacyheaders/types/nsgrid.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/legacyheaders/types/state.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/nb_verlet.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pulling/pull_rotation.h"
 #include "gromacs/swap/swapcoords.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/block.h"
+#include "gromacs/topology/idef.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/qsort_threadsafe.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
 #define DDRANK(dd, rank)    (rank)
index 3f441ad16c21d3c20c8fd2a21f664b513244ca72..413af358019c353bd972b3573bb6aad13a163ad5 100644 (file)
 #ifndef _nbnxn_pairlist_h
 #define _nbnxn_pairlist_h
 
+#include <stddef.h>
+
 #include "thread_mpi/atomic.h"
 
 #include "gromacs/legacyheaders/types/nblist.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
 
 #ifdef __cplusplus
 extern "C" {
index 999b417d6899ce2fdf1da590f279546262a1b193..493fe2a34f695667dfb51a76630573363b56fa6f 100644 (file)
@@ -38,8 +38,6 @@
 
 #include "config.h"
 
-#include <math.h>
-
 #include <immintrin.h>
 
 /* It is cleaner to start the AVX implementation from scratch rather than
index 3b0d90663631b29e7e15b6844e771ef653781a02..95741a661ea58d0bd0fb9fd040ff6f8fc1994375 100644 (file)
 #include "config.h"
 
 #include <stdlib.h>
-#include <string.h>
 
 #include "gromacs/legacyheaders/md_logging.h"
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/smalloc.h"
 
  */
 /* #define DEBUG_WCYCLE */
 
+#ifdef DEBUG_WCYCLE
+#include "gromacs/utility/fatalerror.h"
+#endif
+
 typedef struct
 {
     int          n;
index a2fdfece3e5efe715f5aab3f0c3d32139ee59be9..0c237a122006200f8b8841650c0323769941b9bf 100644 (file)
@@ -39,6 +39,7 @@
 #include "atomprop.h"
 
 #include <ctype.h>
+#include <stdio.h>
 #include <string.h>
 
 #include "gromacs/fileio/strdb.h"
index b069c64419ed63d48d8fbfa2b16773b61cc654d9..19fd0927dcb472479cad967a581139c2ada0ad9d 100644 (file)
 
 #include "mtop_util.h"
 
+#include <limits.h>
+#include <stddef.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#include "gromacs/legacyheaders/types/enums.h"
 #include "gromacs/legacyheaders/types/ifunc.h"
 #include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/atoms.h"
 #include "gromacs/topology/block.h"
-#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/idef.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/topology/topsort.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
 static int gmx_mtop_maxresnr(const gmx_mtop_t *mtop, int maxres_renum)
index 10ed2c7f6df3d40908406808746e8abd85d84d05..9c7e583d25d35a7de1bb31b4910c295761f31e70 100644 (file)
@@ -44,8 +44,6 @@
 #ifndef GMX_UTILITY_BASEDEFINITIONS_H
 #define GMX_UTILITY_BASEDEFINITIONS_H
 
-/* Information about integer data type sizes */
-#include <limits.h>
 #include <stdint.h>
 #ifndef _MSC_VER
 #include <inttypes.h>
index 64ef078feb8833726b0492fb183612e2006d6526..c3a90db5d1085622167ce936e73ee7b78413de48 100644 (file)
 
 #include "config.h"
 
-#include <cctype>
+#include <climits>
 #include <cstdio>
 #include <cstdlib>
 #include <cstring>
 
-#include <algorithm>
 #include <exception>
 
 #ifdef HAVE_UNISTD_H
index f242e2d4483cd52133a7b552f647b6b067a9bd42..ac6593aad5bc3dd64215d431d10673f9ab145725 100644 (file)
@@ -41,7 +41,7 @@
 #include "config.h"
 
 #include <cerrno>
-#include <cstdarg>
+#include <cstddef>
 #include <cstdlib>
 #include <cstring>
 
 
 #include "thread_mpi/threads.h"
 
-#include "gromacs/utility/basenetwork.h"
 #include "gromacs/utility/baseversion.h"
-#include "gromacs/utility/common.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
-#include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/programcontext.h"
-#include "gromacs/utility/smalloc.h"
+
+#ifdef GMX_MPI
+#include "gromacs/utility/basenetwork.h"
+#include "gromacs/utility/gmxmpi.h"
+#else
+#include "gromacs/utility/common.h"
+#endif
 
 static bool                bDebug         = false;
 static tMPI_Thread_mutex_t where_mutex    = TMPI_THREAD_MUTEX_INITIALIZER;
index cacc0a0cbeb8153f5d862ab6e61f779c20397d35..aef668910f07da5135e11bcff5dc5415562534c8 100644 (file)
@@ -73,8 +73,8 @@
 #endif /*MPI_INT64_T*/
 #else
 #ifdef GMX_THREAD_MPI
-#include "thread_mpi/mpi_bindings.h"
-#include "thread_mpi/tmpi.h"
+#include "thread_mpi/mpi_bindings.h" /* IWYU pragma: export */
+#include "thread_mpi/tmpi.h"         /* IWYU pragma: export */
 #else
 typedef void* MPI_Comm;
 typedef void* MPI_Request;
index 93d376cd8a1da0e38cb83c8172819759cc175ec9..330f04b53832e8e090c33ce9762495bb5d44daf9 100644 (file)
 
 #include "config.h"
 
-#ifdef GMX_CXX11 // C++11 Compiler
-#include <memory>
-#include <utility>
-#else      // C++03 Compiler
+#ifdef GMX_CXX11   // C++11 Compiler
+#include <memory>  // IWYU pragma: export
+#include <utility> // IWYU pragma: export
+#else              // C++03 Compiler
 #include <boost/shared_ptr.hpp>
 #endif
 
index d2106f1cb1f7757e503f9bf387c1872b048e36e0..2cc61dcd3d99a8abe48103d22a12b69b97807078 100644 (file)
@@ -38,6 +38,9 @@
 
 #include "thread_mpi/threads.h"
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
index 3b5ab113af8fac191727d64d2706759e830c6e06..e0d6fdeffa99e58d7a6e8ed6533896f81439f52d 100644 (file)
 
 #include "config.h"
 
+#include <math.h>
+#include <stdio.h>
 #include <stdlib.h>
 
+#include "thread_mpi/threads.h"
+
 #include "gromacs/ewald/pme-load-balancing.h"
 #include "gromacs/ewald/pme.h"
-#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/filenm.h"
 #include "gromacs/fileio/mdoutf.h"
 #include "gromacs/fileio/trajectory_writing.h"
-#include "gromacs/fileio/trnio.h"
+#include "gromacs/fileio/trx.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/xtcio.h"
 #include "gromacs/gmxpreprocess/compute_io.h"
 #include "gromacs/imd/imd.h"
 #include "gromacs/legacyheaders/bonded-threading.h"
-#include "gromacs/legacyheaders/calcmu.h"
-#include "gromacs/legacyheaders/checkpoint.h"
 #include "gromacs/legacyheaders/constr.h"
-#include "gromacs/legacyheaders/disre.h"
 #include "gromacs/legacyheaders/domdec.h"
 #include "gromacs/legacyheaders/domdec_network.h"
+#include "gromacs/legacyheaders/ebin.h"
 #include "gromacs/legacyheaders/force.h"
 #include "gromacs/legacyheaders/md_logging.h"
 #include "gromacs/legacyheaders/md_support.h"
 #include "gromacs/legacyheaders/mdatoms.h"
 #include "gromacs/legacyheaders/mdebin.h"
 #include "gromacs/legacyheaders/mdrun.h"
-#include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/nrnb.h"
 #include "gromacs/legacyheaders/ns.h"
-#include "gromacs/legacyheaders/orires.h"
-#include "gromacs/legacyheaders/qmmm.h"
 #include "gromacs/legacyheaders/shellfc.h"
 #include "gromacs/legacyheaders/sighandler.h"
-#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/tgroup.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/update.h"
 #include "gromacs/legacyheaders/vcm.h"
 #include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/constr.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/fcdata.h"
+#include "gromacs/legacyheaders/types/force_flags.h"
+#include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/globsig.h"
+#include "gromacs/legacyheaders/types/group.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
+#include "gromacs/legacyheaders/types/interaction_const.h"
 #include "gromacs/legacyheaders/types/iteratedconstraints.h"
+#include "gromacs/legacyheaders/types/mdatom.h"
+#include "gromacs/legacyheaders/types/membedt.h"
 #include "gromacs/legacyheaders/types/nlistheuristics.h"
+#include "gromacs/legacyheaders/types/nrnb.h"
+#include "gromacs/legacyheaders/types/oenv.h"
+#include "gromacs/legacyheaders/types/shellfc.h"
+#include "gromacs/legacyheaders/types/state.h"
+#include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/math/vectypes.h"
 #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/swap/swapcoords.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/idef.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/real.h"
 #include "gromacs/utility/smalloc.h"
 
 #include "deform.h"