Enable unused function warning
authorRoland Schulz <roland.schulz@intel.com>
Thu, 24 Aug 2017 20:56:21 +0000 (13:56 -0700)
committerRoland Schulz <roland.schulz@intel.com>
Mon, 28 Aug 2017 20:30:49 +0000 (22:30 +0200)
Change-Id: Id00efec9fd2e4edbae328cc291435c202b327492

24 files changed:
cmake/gmxCFlags.cmake
src/gromacs/CMakeLists.txt
src/gromacs/domdec/ga2la.h
src/gromacs/domdec/hash.h
src/gromacs/fft/fft5d.cpp
src/gromacs/fileio/checkpoint.cpp
src/gromacs/gmxana/gmx_nmeig.cpp
src/gromacs/gmxana/interf.h
src/gromacs/gpu_utils/gpu_macros.h
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/math/gmxcomplex.h
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/gmx_omp_nthreads.h
src/gromacs/mdlib/nbnxn_atomdata.cpp
src/gromacs/mdlib/nbnxn_grid.cpp
src/gromacs/mdlib/nbnxn_internal.h
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdtypes/state.cpp
src/gromacs/simd/simd_math.h
src/gromacs/tables/forcetable.cpp
src/gromacs/utility/alignedallocator.cpp
src/programs/mdrun/resource-division.cpp
src/programs/view/dialogs.cpp

index c24f6bb44d960812d41ed7466223a83e85c99b81..4df62a8ee4f58e1d59c9c152238c7828ae0ecdde 100644 (file)
@@ -130,7 +130,7 @@ macro (gmx_c_flags)
             GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
         endif()
         if (GMX_COMPILER_WARNINGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall -Wno-unused-function" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
             # Problematic with CUDA
             # GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EFFCXX "-Wnon-virtual-dtor" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
@@ -312,7 +312,7 @@ GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd411 /wd593 /wd981 /wd1418 /wd1419 /wd1
             GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
         endif()
         if (GMX_COMPILER_WARNINGS)
-            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall -Wno-unused-function" GMXC_CXXFLAGS)
+            GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
             GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS)
         endif()
index 7b8e6f502f001c0e014097660b25e7de005d6f97..087632106db2af807bd3ea2149e66fcda19bfb4c 100644 (file)
@@ -164,9 +164,9 @@ endif()
 # we do it in the compilation command (after testing that the compiler
 # supports the suppressions).
 include(CheckCXXCompilerFlag)
-check_cxx_compiler_flag(-Wno-unused-parameter HAS_NO_UNUSED_PARAMETER)
-if (HAS_NO_UNUSED_PARAMETER)
-    set(_scanner_cpp_compiler_flags "${_scanner_cpp_compiler_flags} -Wno-unused-parameter")
+check_cxx_compiler_flag(-Wno-unused HAS_NO_UNUSED)
+if (HAS_NO_UNUSED)
+    set(_scanner_cpp_compiler_flags "${_scanner_cpp_compiler_flags} -Wno-unused-parameter -Wno-unused-function")
 endif()
 set_source_files_properties(selection/scanner.cpp PROPERTIES COMPILE_FLAGS "${_scanner_cpp_compiler_flags}")
 
index 424c115cf37ade84309b6a3d559e41171ed66e25..f8faac4d34f7a43617c2b73d07e4780bb7e8a3f2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017, 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.
@@ -108,7 +108,7 @@ static void ga2la_clear(gmx_ga2la_t *ga2la)
  * \param[in] natoms_local  An estimate of the number of home+communicated atoms
  * \return a pointer to an initialized gmx_ga2la_t struct
  */
-static gmx_ga2la_t *ga2la_init(int natoms_total, int natoms_local)
+static inline gmx_ga2la_t *ga2la_init(int natoms_total, int natoms_local)
 {
     gmx_ga2la_t *ga2la;
 
@@ -160,7 +160,7 @@ static gmx_ga2la_t *ga2la_init(int natoms_total, int natoms_local)
  * \param[in]     a_loc The local atom index
  * \param[in]     cell  The cell index
  */
-static void ga2la_set(gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
+static inline void ga2la_set(gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
 {
     int ind, ind_prev, i;
 
@@ -213,7 +213,7 @@ static void ga2la_set(gmx_ga2la_t *ga2la, int a_gl, int a_loc, int cell)
  * \param[in,out] ga2la The global to local atom struct
  * \param[in]     a_gl  The global atom index
  */
-static void ga2la_del(gmx_ga2la_t *ga2la, int a_gl)
+static inline void ga2la_del(gmx_ga2la_t *ga2la, int a_gl)
 {
     int ind, ind_prev;
 
@@ -262,7 +262,7 @@ static void ga2la_del(gmx_ga2la_t *ga2la, int a_gl)
  * \param[in]     a_gl  The global atom index
  * \param[in]     a_loc The new local atom index
  */
-static void ga2la_change_la(gmx_ga2la_t *ga2la, int a_gl, int a_loc)
+static inline void ga2la_change_la(gmx_ga2la_t *ga2la, int a_gl, int a_loc)
 {
     int ind;
 
@@ -297,7 +297,7 @@ static void ga2la_change_la(gmx_ga2la_t *ga2la, int a_gl, int a_loc)
  * \param[out] cell  If the return value is TRUE, the zone or for atoms more than one cell away zone+nzone
  * \return if the global atom a_gl available locally
  */
-static gmx_bool ga2la_get(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *cell)
+static inline gmx_bool ga2la_get(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *cell)
 {
     int ind;
 
@@ -333,7 +333,7 @@ static gmx_bool ga2la_get(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc, int *c
  * \param[out] a_loc If the return value is TRUE, the local atom index
  * \return if the global atom a_gl is a home atom
  */
-static gmx_bool ga2la_get_home(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
+static inline gmx_bool ga2la_get_home(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
 {
     int ind;
 
@@ -373,7 +373,7 @@ static gmx_bool ga2la_get_home(const gmx_ga2la_t *ga2la, int a_gl, int *a_loc)
  * \param[in]  a_gl  The global atom index
  * \return if the global atom a_gl is a home atom
  */
-static gmx_bool ga2la_is_home(const gmx_ga2la_t *ga2la, int a_gl)
+static inline gmx_bool ga2la_is_home(const gmx_ga2la_t *ga2la, int a_gl)
 {
     int ind;
 
index 0f6b54c64ffc898ad7ac667eadaba0d1abd2f276..3d3b8f15f839a4d93cda5df50af69c42a202382d 100644 (file)
@@ -135,7 +135,7 @@ static void gmx_hash_realloc(gmx_hash_t *hash, int nkey_used_estimate)
  * With the current number of keys check if the table size is still
  * good, if not optimize it with the current number of keys.
  */
-static void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
+static inline void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
 {
     /* Resize the hash table when the occupation is < 1/4 or > 2/3 */
     if (hash->nkey > 0 &&
@@ -153,7 +153,7 @@ static void gmx_hash_clear_and_optimize(gmx_hash_t *hash)
 }
 
 //! Initialize hash table.
-static gmx_hash_t *gmx_hash_init(int nkey_used_estimate)
+static inline gmx_hash_t *gmx_hash_init(int nkey_used_estimate)
 {
     gmx_hash_t *hash;
 
@@ -210,7 +210,7 @@ static void gmx_hash_set(gmx_hash_t *hash, int key, int value)
 }
 
 //! Delete the hash entry for key.
-static void gmx_hash_del(gmx_hash_t *hash, int key)
+static inline void gmx_hash_del(gmx_hash_t *hash, int key)
 {
     int ind, ind_prev;
 
@@ -249,7 +249,7 @@ static void gmx_hash_del(gmx_hash_t *hash, int key)
 }
 
 //! Change the value for present hash entry for key.
-static void gmx_hash_change_value(gmx_hash_t *hash, int key, int value)
+static inline void gmx_hash_change_value(gmx_hash_t *hash, int key, int value)
 {
     int ind;
 
@@ -270,7 +270,7 @@ static void gmx_hash_change_value(gmx_hash_t *hash, int key, int value)
 }
 
 //! Change the hash value if already set, otherwise set the hash value.
-static void gmx_hash_change_or_set(gmx_hash_t *hash, int key, int value)
+static inline void gmx_hash_change_or_set(gmx_hash_t *hash, int key, int value)
 {
     int ind;
 
@@ -293,7 +293,7 @@ static void gmx_hash_change_or_set(gmx_hash_t *hash, int key, int value)
 }
 
 //! Returns if the key is present, if the key is present *value is set.
-static gmx_bool gmx_hash_get(const gmx_hash_t *hash, int key, int *value)
+static inline gmx_bool gmx_hash_get(const gmx_hash_t *hash, int key, int *value)
 {
     int ind;
 
index d57cc2cc8e648e475d6711564e2367143beff870..e46667b9d074f1b260ed4688b31435dda34a8913 100644 (file)
@@ -102,36 +102,6 @@ static int lfactor(int z)
 }
 #endif
 
-/* largest factor */
-static int l2factor(int z)
-{
-    int i;
-    if (z == 1)
-    {
-        i = 1;
-    }
-    else
-    {
-        i = z/2;
-        while (z%i != 0)
-        {
-            i--;
-        }
-    }
-    return i;
-}
-
-/* largest prime factor: WARNING: slow recursion, only use for small numbers */
-static int lpfactor(int z)
-{
-    int f = l2factor(z);
-    if (f == 1)
-    {
-        return z;
-    }
-    return std::max(lpfactor(f), lpfactor(z/f));
-}
-
 #if !GMX_MPI
 #if HAVE_GETTIMEOFDAY
 #include <sys/time.h>
index ed32aa6545d0499781a4c8c4ceecf81227ba53b0..4b1dfa16bfd94fda7ed3a313ebca3dc40738b7ad 100644 (file)
@@ -445,7 +445,7 @@ static bool_t listXdrVector(XDR *xd, StatePart part, int ecpt, int nf, int xdrTy
 }
 
 //! \brief Convert a double array, typed char*, to float
-static void convertArrayRealPrecision(const char *c, float *v, int n)
+gmx_unused static void convertArrayRealPrecision(const char *c, float *v, int n)
 {
     // cppcheck-suppress invalidPointerCast
     const double *d = reinterpret_cast<const double *>(c);
index f29997f887690cb02468383ee8adfd7f82c634a9..71b7b558f01f2144bb0e17e2a865b2fa99fc1781 100644 (file)
@@ -108,22 +108,6 @@ static size_t get_nharm_mt(const gmx_moltype_t *mt)
     return nh;
 }
 
-static size_t get_nvsite_mt(gmx_moltype_t *mt)
-{
-    static int   vs_func[] = {
-        F_VSITE2, F_VSITE3, F_VSITE3FD, F_VSITE3FAD,
-        F_VSITE3OUT, F_VSITE4FD, F_VSITE4FDN, F_VSITEN
-    };
-    int          i, ft;
-    size_t       nh = 0;
-    for (i = 0; (i < asize(vs_func)); i++)
-    {
-        ft  = vs_func[i];
-        nh += mt->ilist[ft].nr/(interaction_function[ft].nratoms+1);
-    }
-    return nh;
-}
-
 static int get_nharm(const gmx_mtop_t *mtop)
 {
     int nh = 0;
index b909f345fd7b21b4693e998e1a3193c56d169662..435604be743dfde8cbcd4ad84d331a4240b5c0b0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014,2015,2017, 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.
@@ -43,7 +43,7 @@ typedef struct {
     real t; /* Interface thickness */
 } t_interf;
 
-static void init_interf(t_interf *surf)
+static inline void init_interf(t_interf *surf)
 {
     surf->Z = 0;
     surf->t = 0;
index ba107a4ae7b2febb32ad2e9da61c1f5887b0e3d3..182c2035bead423318fee60f6690800b2f39c40f 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,2017, 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.
@@ -45,7 +45,7 @@
 #define REAL_FUNC_TERM ;
 #define REAL_FUNC_TERM_WITH_RETURN(arg) ;
 
-#define NULL_FUNC_QUALIFIER static
+#define NULL_FUNC_QUALIFIER gmx_unused static
 #define NULL_FUNC_ARGUMENT(arg) /*arg*/
 #define NULL_FUNC_TERM {}
 #define NULL_FUNC_TERM_WITH_RETURN(arg) { return (arg); }
index 7dd57dc18b5d356979a80e3bfd78cf4cd439ece0..d7aa51928e2f8e5f4360b5e130ec50abd4a906d5 100644 (file)
@@ -827,7 +827,7 @@ detectProcCpuInfoArm(const std::map<std::string, std::string>   &cpuInfo,
  *  much more fragile than our x86 detection, but it does not depend on
  *  specific system calls, intrinsics or assembly instructions.
  */
-void
+gmx_unused void
 detectProcCpuInfo(CpuInfo::Vendor *              vendor,
                   std::string   *                brand,
                   int   *                        family,
index bffd94fe870b68ace130918d9e346fbab1f2d687..aabddbaebb91f4821c99ddd4da35627745e25eb2 100644 (file)
@@ -58,7 +58,7 @@ static t_complex rcmul(real r, t_complex c)
     return d;
 }
 
-static t_complex rcexp(real r)
+static inline t_complex rcexp(real r)
 {
     t_complex c;
 
@@ -69,7 +69,7 @@ static t_complex rcexp(real r)
 }
 
 
-static t_complex cadd(t_complex a, t_complex b)
+static inline t_complex cadd(t_complex a, t_complex b)
 {
     t_complex c;
 
@@ -79,7 +79,7 @@ static t_complex cadd(t_complex a, t_complex b)
     return c;
 }
 
-static t_complex csub(t_complex a, t_complex b)
+static inline t_complex csub(t_complex a, t_complex b)
 {
     t_complex c;
 
@@ -109,7 +109,7 @@ static t_complex conjugate(t_complex c)
     return d;
 }
 
-static real cabs2(t_complex c)
+static inline real cabs2(t_complex c)
 {
     real abs2;
     abs2 = (c.re*c.re)+(c.im*c.im);
@@ -117,7 +117,7 @@ static real cabs2(t_complex c)
     return abs2;
 }
 
-static t_complex cdiv(t_complex teller, t_complex noemer)
+static inline t_complex cdiv(t_complex teller, t_complex noemer)
 {
     t_complex res, anoemer;
 
index 687a9bc432f2f688316616df8ddb1a8120887a61..2b7844c56bcb77a4b2957809f3419ce360e6d15f 100644 (file)
@@ -753,17 +753,18 @@ calc_dr_x_xp_simd(int                       b0,
 #endif // GMX_SIMD_HAVE_REAL
 
 /* Determine the distances and right-hand side for the next iteration */
-static void calc_dist_iter(int                       b0,
-                           int                       b1,
-                           const int *               bla,
-                           const rvec * gmx_restrict xp,
-                           const real * gmx_restrict bllen,
-                           const real * gmx_restrict blc,
-                           const t_pbc *             pbc,
-                           real                      wfac,
-                           real * gmx_restrict       rhs,
-                           real * gmx_restrict       sol,
-                           gmx_bool *                bWarn)
+gmx_unused static void calc_dist_iter(
+        int                       b0,
+        int                       b1,
+        const int *               bla,
+        const rvec * gmx_restrict xp,
+        const real * gmx_restrict bllen,
+        const real * gmx_restrict blc,
+        const t_pbc *             pbc,
+        real                      wfac,
+        real * gmx_restrict       rhs,
+        real * gmx_restrict       sol,
+        gmx_bool *                bWarn)
 {
     int b;
 
index dfa8f7944e9547aa05c0aae0f088d3ae34c22a48..510825bb83435829b5b673cf878d574550adc7b7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, 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.
@@ -82,7 +82,7 @@ int gmx_omp_nthreads_get(int mod);
  * the reduction in computional cost due to parallelization. This routine
  * returns 1 when the overhead is expected to be higher than the gain.
  */
-static int gmx_omp_nthreads_get_simple_rvec_task(int mod, int nrvec)
+static inline int gmx_omp_nthreads_get_simple_rvec_task(int mod, int nrvec)
 {
     /* There can be a relatively large overhead to an OpenMP parallel for loop.
      * This overhead increases, slowly, with the numbe of threads used.
index 619c760f1befe195e3156c9576a1b6a46ad38148..66f93481788dc895a274996e14367ce4c594221b 100644 (file)
@@ -192,67 +192,6 @@ static void copy_int_to_nbat_int(const int *a, int na, int na_round,
     }
 }
 
-static void clear_nbat_real(int na, int nbatFormat, real *xnb, int a0)
-{
-    int j, c;
-
-    switch (nbatFormat)
-    {
-        case nbatXYZ:
-            for (int a = 0; a < na; a++)
-            {
-                for (int d = 0; d < DIM; d++)
-                {
-                    xnb[(a0+a)*STRIDE_XYZ+d] = 0;
-                }
-            }
-            break;
-        case nbatXYZQ:
-            for (int a = 0; a < na; a++)
-            {
-                for (int d = 0; d < DIM; d++)
-                {
-                    xnb[(a0+a)*STRIDE_XYZQ+d] = 0;
-                }
-            }
-            break;
-        case nbatX4:
-            j = atom_to_x_index<c_packX4>(a0);
-            c = a0 & (c_packX4 - 1);
-            for (int a = 0; a < na; a++)
-            {
-                xnb[j+XX*c_packX4] = 0;
-                xnb[j+YY*c_packX4] = 0;
-                xnb[j+ZZ*c_packX4] = 0;
-                j++;
-                c++;
-                if (c == c_packX4)
-                {
-                    j += (DIM-1)*c_packX4;
-                    c  = 0;
-                }
-            }
-            break;
-        case nbatX8:
-            j = atom_to_x_index<c_packX8>(a0);
-            c = a0 & (c_packX8-1);
-            for (int a = 0; a < na; a++)
-            {
-                xnb[j+XX*c_packX8] = 0;
-                xnb[j+YY*c_packX8] = 0;
-                xnb[j+ZZ*c_packX8] = 0;
-                j++;
-                c++;
-                if (c == c_packX8)
-                {
-                    j += (DIM-1)*c_packX8;
-                    c  = 0;
-                }
-            }
-            break;
-    }
-}
-
 void copy_rvec_to_nbat_real(const int *a, int na, int na_round,
                             const rvec *x, int nbatFormat,
                             real *xnb, int a0)
@@ -1220,7 +1159,7 @@ nbnxn_atomdata_clear_reals(real * gmx_restrict dest,
     }
 }
 
-static void
+gmx_unused static void
 nbnxn_atomdata_reduce_reals(real * gmx_restrict dest,
                             gmx_bool bDestSet,
                             real ** gmx_restrict src,
@@ -1252,7 +1191,7 @@ nbnxn_atomdata_reduce_reals(real * gmx_restrict dest,
     }
 }
 
-static void
+gmx_unused static void
 nbnxn_atomdata_reduce_reals_simd(real gmx_unused * gmx_restrict dest,
                                  gmx_bool gmx_unused bDestSet,
                                  real gmx_unused ** gmx_restrict src,
index 39198000157b602c1a06c031602620291b411545..513d0c9e0845950fecd0db2162ee37cf5a0789fd 100644 (file)
@@ -505,8 +505,8 @@ static void calc_bounding_box_x_x8(int na, const real *x, nbnxn_bb_t *bb)
 }
 
 /* Packed coordinates, bb order xyz0 */
-static void calc_bounding_box_x_x4_halves(int na, const real *x,
-                                          nbnxn_bb_t *bb, nbnxn_bb_t *bbj)
+gmx_unused static void calc_bounding_box_x_x4_halves(int na, const real *x,
+                                                     nbnxn_bb_t *bb, nbnxn_bb_t *bbj)
 {
     // TODO: During SIMDv2 transition only some archs use namespace (remove when done)
     using namespace gmx;
@@ -1409,21 +1409,6 @@ static void calc_cell_indices(const nbnxn_search_t nbs,
     }
 }
 
-static void init_buffer_flags(nbnxn_buffer_flags_t *flags,
-                              int                   natoms)
-{
-    flags->nflag = (natoms + NBNXN_BUFFERFLAG_SIZE - 1)/NBNXN_BUFFERFLAG_SIZE;
-    if (flags->nflag > flags->flag_nalloc)
-    {
-        flags->flag_nalloc = over_alloc_large(flags->nflag);
-        srenew(flags->flag, flags->flag_nalloc);
-    }
-    for (int b = 0; b < flags->nflag; b++)
-    {
-        bitmask_clear(&(flags->flag[b]));
-    }
-}
-
 /* Sets up a grid and puts the atoms on the grid.
  * This function only operates on one domain of the domain decompostion.
  * Note that without domain decomposition there is only one domain.
index 6b51f14cec0b2d3a1a347b6e6f35b47616bc2a4b..625e595546651e78bac67a0e8781c8faf1ca9e12 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, 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.
@@ -226,13 +226,6 @@ typedef void
                        int stride, const real *x,
                        nbnxn_list_work_t *work);
 
-static gmx_icell_set_x_t icell_set_x_simple;
-#if GMX_SIMD
-static gmx_icell_set_x_t icell_set_x_simple_simd_4xn;
-static gmx_icell_set_x_t icell_set_x_simple_simd_2xnn;
-#endif
-static gmx_icell_set_x_t icell_set_x_supersub;
-
 /* Local cycle count struct for profiling */
 typedef struct {
     int          count;
@@ -298,12 +291,12 @@ typedef struct nbnxn_search {
 } nbnxn_search_t_t;
 
 
-static void nbs_cycle_start(nbnxn_cycle_t *cc)
+static inline void nbs_cycle_start(nbnxn_cycle_t *cc)
 {
     cc->start = gmx_cycles_read();
 }
 
-static void nbs_cycle_stop(nbnxn_cycle_t *cc)
+static inline void nbs_cycle_stop(nbnxn_cycle_t *cc)
 {
     cc->c += gmx_cycles_read() - cc->start;
     cc->count++;
index 297c0531e36ab1daa2337627b7a4b3c6c18c2c89..2bb44adc54ffe28d566227ca8363b2bd283e3908 100644 (file)
@@ -121,7 +121,7 @@ static void nbs_cycle_print(FILE *fp, const nbnxn_search_t nbs)
     fprintf(fp, "\n");
 }
 
-static gmx_inline int ci_to_cj(int ci, int na_cj_2log)
+gmx_unused static gmx_inline int ci_to_cj(int ci, int na_cj_2log)
 {
     switch (na_cj_2log)
     {
@@ -386,10 +386,11 @@ static void get_cell_range(real b0, real b1,
 }
 
 /* Reference code calculating the distance^2 between two bounding boxes */
-static float box_dist2(float bx0, float bx1, float by0,
+/*
+   static float box_dist2(float bx0, float bx1, float by0,
                        float by1, float bz0, float bz1,
                        const nbnxn_bb_t *bb)
-{
+   {
     float d2;
     float dl, dh, dm, dm0;
 
@@ -414,7 +415,8 @@ static float box_dist2(float bx0, float bx1, float by0,
     d2 += dm0*dm0;
 
     return d2;
-}
+   }
+ */
 
 /* Plain C code calculating the distance^2 between two bounding boxes */
 static float subc_bb_dist2(int si, const nbnxn_bb_t *bb_i_ci,
@@ -1134,7 +1136,7 @@ static unsigned int get_imask(gmx_bool rdiag, int ci, int cj)
 }
 
 /* Returns a diagonal or off-diagonal interaction mask for cj-size=2 */
-static unsigned int get_imask_simd_j2(gmx_bool rdiag, int ci, int cj)
+gmx_unused static unsigned int get_imask_simd_j2(gmx_bool rdiag, int ci, int cj)
 {
     return (rdiag && ci*2 == cj ? NBNXN_INTERACTION_MASK_DIAG_J2_0 :
             (rdiag && ci*2+1 == cj ? NBNXN_INTERACTION_MASK_DIAG_J2_1 :
@@ -1142,13 +1144,13 @@ static unsigned int get_imask_simd_j2(gmx_bool rdiag, int ci, int cj)
 }
 
 /* Returns a diagonal or off-diagonal interaction mask for cj-size=4 */
-static unsigned int get_imask_simd_j4(gmx_bool rdiag, int ci, int cj)
+gmx_unused static unsigned int get_imask_simd_j4(gmx_bool rdiag, int ci, int cj)
 {
     return (rdiag && ci == cj ? NBNXN_INTERACTION_MASK_DIAG : NBNXN_INTERACTION_MASK_ALL);
 }
 
 /* Returns a diagonal or off-diagonal interaction mask for cj-size=8 */
-static unsigned int get_imask_simd_j8(gmx_bool rdiag, int ci, int cj)
+gmx_unused static unsigned int get_imask_simd_j8(gmx_bool rdiag, int ci, int cj)
 {
     return (rdiag && ci == cj*2 ? NBNXN_INTERACTION_MASK_DIAG_J8_0 :
             (rdiag && ci == cj*2+1 ? NBNXN_INTERACTION_MASK_DIAG_J8_1 :
@@ -2464,9 +2466,9 @@ static void set_icell_bbxxxx_supersub(const float *bb, int ci,
 #endif
 
 /* Sets a super-cell and sub cell bounding boxes, including PBC shift */
-static void set_icell_bb_supersub(const nbnxn_bb_t *bb, int ci,
-                                  real shx, real shy, real shz,
-                                  nbnxn_bb_t *bb_ci)
+gmx_unused static void set_icell_bb_supersub(const nbnxn_bb_t *bb, int ci,
+                                             real shx, real shy, real shz,
+                                             nbnxn_bb_t *bb_ci)
 {
     for (int i = 0; i < c_gpuNumClusterPerCell; i++)
     {
index 867b8d74e7931711fd9c787b31c6148859a581fd..4a86d085c5a24341d42a9c7510eb004a34cb067d 100644 (file)
@@ -167,7 +167,7 @@ static const int c_ftypeVsiteEnd   = F_VSITEN + 1;
 
 
 /* Returns the sum of the vsite ilist sizes over all vsite types */
-static int vsiteIlistNrCount(const t_ilist *ilist)
+gmx_unused static int vsiteIlistNrCount(const t_ilist *ilist)
 {
     int nr = 0;
     for (int ftype = c_ftypeVsiteStart; ftype < c_ftypeVsiteEnd; ftype++)
index da61056e5e69e7bca49f63631ddba278a9fb4df6..a5d0711173086eb062a507002040b4c16847218a 100644 (file)
@@ -82,24 +82,6 @@ ekinstate_t::ekinstate_t() : bUpToDate(FALSE),
     clear_mat(ekin_total);
 };
 
-static void init_swapstate(swaphistory_t *swapstate)
-{
-    /* Ion/water position swapping */
-    swapstate->eSwapCoords            = 0;
-    swapstate->nIonTypes              = 0;
-    swapstate->nAverage               = 0;
-    swapstate->fluxleak               = 0;
-    swapstate->fluxleak_p             = nullptr;
-    swapstate->bFromCpt               = 0;
-    swapstate->nat[eChan0]            = 0;
-    swapstate->nat[eChan1]            = 0;
-    swapstate->xc_old_whole[eChan0]   = nullptr;
-    swapstate->xc_old_whole[eChan1]   = nullptr;
-    swapstate->xc_old_whole_p[eChan0] = nullptr;
-    swapstate->xc_old_whole_p[eChan1] = nullptr;
-    swapstate->ionType                = nullptr;
-}
-
 void init_gtc_state(t_state *state, int ngtc, int nnhpres, int nhchainlength)
 {
     state->ngtc          = ngtc;
index ec8aa4188f7d95d43bc452a3f0e48ce003b00952..71d0b4fcf1a7124482c81b2eded4fdbcc9b0c327 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017, 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.
@@ -3658,7 +3658,7 @@ atan2SingleAccuracy(SimdDouble y, SimdDouble x)
  * added to \f$1/r\f$ the error will be insignificant.
  *
  */
-static SimdDouble gmx_simdcall
+static inline SimdDouble gmx_simdcall
 pmeForceCorrectionSingleAccuracy(SimdDouble z2)
 {
     const SimdDouble  FN6(-1.7357322914161492954e-8);
@@ -3730,7 +3730,7 @@ pmeForceCorrectionSingleAccuracy(SimdDouble z2)
  * This approximation achieves an accuracy slightly lower than 1e-6; when
  * added to \f$1/r\f$ the error will be insignificant.
  */
-static SimdDouble gmx_simdcall
+static inline SimdDouble gmx_simdcall
 pmePotentialCorrectionSingleAccuracy(SimdDouble z2)
 {
     const SimdDouble  VN6(1.9296833005951166339e-8);
index 6fb0ad04de0f27c1b79585679bf46619b500c721..cf49c48f2f2092bcde31dea283f29b05cc5201c6 100644 (file)
@@ -382,37 +382,6 @@ real ewald_spline3_table_scale(const interaction_const_t *ic)
     return sc;
 }
 
-/* Calculate the potential and force for an r value
- * in exactly the same way it is done in the inner loop.
- * VFtab is a pointer to the table data, offset is
- * the point where we should begin and stride is
- * 4 if we have a buckingham table, 3 otherwise.
- * If you want to evaluate table no N, set offset to 4*N.
- *
- * We use normal precision here, since that is what we
- * will use in the inner loops.
- */
-static void evaluate_table(real VFtab[], int offset, int stride,
-                           real tabscale, real r, real *y, real *yp)
-{
-    int  n;
-    real rt, eps, eps2;
-    real Y, F, Geps, Heps2, Fp;
-
-    rt       =  r*tabscale;
-    n        =  (int)rt;
-    eps      =  rt - n;
-    eps2     =  eps*eps;
-    n        =  offset+stride*n;
-    Y        =  VFtab[n];
-    F        =  VFtab[n+1];
-    Geps     =  eps*VFtab[n+2];
-    Heps2    =  eps2*VFtab[n+3];
-    Fp       =  F+Geps+Heps2;
-    *y       =  Y+eps*Fp;
-    *yp      =  (Fp+Geps+2.0*Heps2)*tabscale;
-}
-
 static void copy2table(int n, int offset, int stride,
                        double x[], double Vtab[], double Ftab[], real scalefactor,
                        real dest[])
index 5821a5970df1bd31d2171cee46639eb9d6bae68f..3c51372f8212bf9b29df71f7ba7ff9563782ade5 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,2017, 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.
@@ -87,7 +87,7 @@ namespace internal
  *        gmx::alignedMalloc(). Just like system-provided routines, it provides
  *        memory that is aligned - but not padded.
  */
-static void *
+gmx_unused static void *
 alignedMallocGeneric(std::size_t bytes, std::size_t alignment)
 {
     // The amount of extra memory (beyound what the user asked for) we need is:
@@ -127,7 +127,7 @@ alignedMallocGeneric(std::size_t bytes, std::size_t alignment)
  * \note  This is an internal routine that should only be called from
  *        gmx::alignedFree().
  */
-static void
+gmx_unused static void
 alignedFreeGeneric(void *p)
 {
     if (p)
index 8a3a293b64c677b7048b722d668f20c922ffbe4e..28e1e225a518b3b0f9e6f4c150711669493de7e3 100644 (file)
@@ -164,9 +164,9 @@ static int nthreads_omp_faster(const gmx::CpuInfo &cpuInfo, gmx_bool bUseGPU)
 }
 
 /* Returns that maximum OpenMP thread count that passes the efficiency check */
-static int nthreads_omp_efficient_max(int gmx_unused       nrank,
-                                      const gmx::CpuInfo  &cpuInfo,
-                                      gmx_bool             bUseGPU)
+gmx_unused static int nthreads_omp_efficient_max(int gmx_unused       nrank,
+                                                 const gmx::CpuInfo  &cpuInfo,
+                                                 gmx_bool             bUseGPU)
 {
 #if GMX_OPENMP && GMX_MPI
     if (nrank > 1)
@@ -183,10 +183,10 @@ static int nthreads_omp_efficient_max(int gmx_unused       nrank,
 /* Return the number of thread-MPI ranks to use.
  * This is chosen such that we can always obey our own efficiency checks.
  */
-static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
-                                        const gmx_hw_opt_t  &hw_opt,
-                                        int                  nthreads_tot,
-                                        int                  ngpu)
+gmx_unused static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
+                                                   const gmx_hw_opt_t  &hw_opt,
+                                                   int                  nthreads_tot,
+                                                   int                  ngpu)
 {
     int                 nrank;
     const gmx::CpuInfo &cpuInfo = *hwinfo->cpuInfo;
@@ -265,8 +265,8 @@ static int get_tmpi_omp_thread_division(const gmx_hw_info_t *hwinfo,
 }
 
 
-static int getMaxGpuUsable(const gmx_hw_info_t *hwinfo,
-                           int                  cutoff_scheme)
+gmx_unused static int getMaxGpuUsable(const gmx_hw_info_t *hwinfo,
+                                      int                  cutoff_scheme)
 {
     /* This code relies on the fact that GPU are not detected when GPU
      * acceleration was disabled at run time by the user, either with
index 8d31b68d9feda6b4e3539481823c72d2f5f3a20c..4005555dc194543c8ad6dbb0ee639e958efc922c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017, 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.
@@ -253,17 +253,6 @@ enum {
     eg0, egTOPOL, egCONFIN, egPARAM, eg1, eg1PROC, eg32PROC
 };
 
-static void Extract(t_dlg *dlg, int ID, char *buf)
-{
-    char *et;
-
-    et = EditText(dlg, ID);
-    if (et)
-    {
-        std::strcpy(buf, et);
-    }
-}
-
 enum bond_set {
     ebShowH = 11, ebDPlus, ebRMPBC, ebCue, ebSkip, ebWait
 };
@@ -413,19 +402,6 @@ enum {
     esFUNCT = 1, esBSHOW, esINFIL, esINDEXFIL, esLSQ, esSHOW, esPLOTFIL
 };
 
-static bool in_set(int i, int n, int set[])
-{
-    int j;
-    for (j = 0; (j < n); j++)
-    {
-        if (set[j] == i)
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
 typedef t_dlg *t_mmb (t_x11 *x11, t_gmx *gmx);
 
 typedef struct {