Turn on -Wunused-parameter where applicable
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 29 Oct 2013 17:53:39 +0000 (18:53 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 1 Dec 2013 12:34:06 +0000 (13:34 +0100)
There are no longer any function parameters that have function
arguments that are unused (under at least some code paths), unless
they are so noted with gmx_unused attributes. This commit activates
the applicable compiler warnings, so that we can keep it that way!

Some extra changes in gmxomp.c to satisfy Doxygen and remove unused
variable warnings as well (moved the file to C++ compilation).
As a side effect, simplify the #ifdef logic.  The only visible effect of
the reorganization should be that if both affinity environment variables
are set, then the warnings get printed in reverse order.

Also run uncrustify and copyright on changed files.

Change-Id: Ifbaba7543f30c94b44b649718c0c5d7ff1fe5db0

26 files changed:
cmake/gmxCFlags.cmake
src/gromacs/fft/fft_fftpack.c
src/gromacs/fileio/gmx_system_xdr.c
src/gromacs/gmxana/geminate.c
src/gromacs/gmxana/gmx_hbond.c
src/gromacs/gmxlib/gmx_detect_hardware.c
src/gromacs/gmxlib/gmx_thread_affinity.c
src/gromacs/gmxlib/maths.c
src/gromacs/gmxlib/network.c
src/gromacs/legacyheaders/gpu_utils.h
src/gromacs/mdlib/domdec.c
src/gromacs/mdlib/domdec_network.c
src/gromacs/mdlib/forcerec.c
src/gromacs/mdlib/genborn.c
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128d.h
src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_utils_x86_128s.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h
src/gromacs/mdlib/nbnxn_search.c
src/gromacs/mdlib/partdec.c
src/gromacs/mdlib/pme.c
src/gromacs/mdlib/pme_pp.c
src/gromacs/timing/wallcycle.c
src/gromacs/utility/gmxomp.cpp [moved from src/gromacs/utility/gmxomp.c with 87% similarity]
src/programs/mdrun/repl_ex.c
src/programs/mdrun/runner.c

index 1d94613a775f5193a4cc8b35b40a9728607678e8..e85932a2c27cd34fa0e3894b3e5d13da3a2c308b 100644 (file)
@@ -67,7 +67,7 @@ MACRO(gmx_c_flags)
         if(NOT GMX_OPENMP)
             GMX_TEST_CFLAG(CFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CFLAGS)
         endif()
-        GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused -Wunused-value" GMXC_CFLAGS)
+        GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused -Wunused-value -Wunused-parameter" GMXC_CFLAGS)
         GMX_TEST_CFLAG(CFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wno-sign-compare" GMXC_CFLAGS)
         # new in gcc 4.5
         GMX_TEST_CFLAG(CFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CFLAGS_RELEASE)
@@ -168,7 +168,7 @@ MACRO(gmx_c_flags)
         if(NOT GMX_OPENMP)
             GMX_TEST_CFLAG(CFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CFLAGS)
         endif()
-        GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused -Wunused-value" GMXC_CFLAGS)
+        GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused -Wunused-value -Wunused-parameter" GMXC_CFLAGS)
     endif()
 
     if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
index 3221acc4dea29623655983d2585a190c75dc9439..f56f40d0b0ba9492a68639e7234e57c7d59723c9 100644 (file)
@@ -43,6 +43,7 @@
 #include <errno.h>
 
 #include "gromacs/fft/fft.h"
+#include "gromacs/legacyheaders/types/simple.h"
 #include "gmx_fatal.h"
 
 #include "external/fftpack/fftpack.h"
@@ -78,7 +79,7 @@ struct gmx_fft
 int
 gmx_fft_init_1d(gmx_fft_t *        pfft,
                 int                nx,
-                int                flags)
+                int gmx_unused     flags)
 {
     gmx_fft_t    fft;
 
@@ -118,7 +119,7 @@ gmx_fft_init_1d(gmx_fft_t *        pfft,
 int
 gmx_fft_init_1d_real(gmx_fft_t *        pfft,
                      int                nx,
-                     int                flags)
+                     int gmx_unused     flags)
 {
     gmx_fft_t    fft;
 
index 00155532e84aafa340b5453530b62f2a7928631a..0bee3665fe8ff68198180ae8f5266333fd11e9d6 100644 (file)
@@ -748,6 +748,8 @@ xdrstdio_setpos (XDR *xdrs, unsigned int pos)
 static xdr_int32_t *
 xdrstdio_inline (XDR *xdrs, int len)
 {
+    (void)xdrs;
+    (void)len;
     /*
      * Must do some work to implement this: must insure
      * enough data in the underlying stdio buffer,
index 10428e0f98834866702e89ea30b6e33907e168da..ef4cf15f75b56c9657b13e22826f9aad5f92f6b6 100644 (file)
@@ -649,8 +649,11 @@ static double gemFunc_residual2(const gsl_vector *p, void *data)
 
 static real* d2r(const double *d, const int nn);
 
-extern real fitGemRecomb(double *ct, double *time, double **ctFit,
-                         const int nData, t_gemParams *params)
+extern real fitGemRecomb(double gmx_unused      *ct,
+                         double gmx_unused      *time,
+                         double gmx_unused     **ctFit,
+                         const int gmx_unused    nData,
+                         t_gemParams gmx_unused *params)
 {
 
     int         nThreads, i, iter, status, maxiter;
@@ -910,7 +913,7 @@ static int balFunc_fdf(const gsl_vector *params, void *data,
 /* Removes the ballistic term from the beginning of the ACF,
  * just like in Omer's paper.
  */
-extern void takeAwayBallistic(double *ct, double *t, int len, real tMax, int nexp, gmx_bool bDerivative)
+extern void takeAwayBallistic(double gmx_unused *ct, double *t, int len, real tMax, int nexp, gmx_bool gmx_unused bDerivative)
 {
 
     /* Use nonlinear regression with GSL instead.
index d99a0f306329884e76d4ee2adc53d55668d14bc4..57de1a289c946c5013a79808ba9296f70d3398eb 100644 (file)
@@ -2449,14 +2449,16 @@ static real quality_of_fit(real chi2, int N)
 }
 
 #else
-static real optimize_luzar_parameters(FILE *fp, t_luzar *tl, int maxiter,
-                                      real tol)
+static real optimize_luzar_parameters(FILE gmx_unused    *fp,
+                                      t_luzar gmx_unused *tl,
+                                      int gmx_unused      maxiter,
+                                      real gmx_unused     tol)
 {
     fprintf(stderr, "This program needs the GNU scientific library to work.\n");
 
     return -1;
 }
-static real quality_of_fit(real chi2, int N)
+static real quality_of_fit(real gmx_unused chi2, int gmx_unused N)
 {
     fprintf(stderr, "This program needs the GNU scientific library to work.\n");
 
index 48e45e3106b7d0de9d4065eb328376a938372da6..b393edc7fb0e379b9ec58a2212ec694c173f79dd 100644 (file)
@@ -85,7 +85,7 @@ static void limit_num_gpus_used(gmx_gpu_opt_t *gpu_opt, int count);
 static int gmx_count_gpu_dev_unique(const gmx_gpu_info_t *gpu_info,
                                     const gmx_gpu_opt_t  *gpu_opt);
 
-static void sprint_gpus(char *sbuf, const gmx_gpu_info_t *gpu_info, gmx_bool bPrintAll)
+static void sprint_gpus(char *sbuf, const gmx_gpu_info_t *gpu_info)
 {
     int      i, ndev;
     char     stmp[STRLEN];
@@ -131,7 +131,7 @@ static void print_gpu_detection_stats(FILE                 *fplog,
 
     if (ngpu > 0)
     {
-        sprint_gpus(stmp, gpu_info, TRUE);
+        sprint_gpus(stmp, gpu_info);
         md_print_warn(cr, fplog, "%d GPU%s detected%s:\n%s\n",
                       ngpu, (ngpu > 1) ? "s" : "", onhost, stmp);
     }
@@ -208,7 +208,7 @@ static void parse_gpu_id_plain_string(const char *idstr, int *nid, int **idlist)
     }
 }
 
-static void parse_gpu_id_csv_string(const char *idstr, int *nid, int *idlist)
+static void parse_gpu_id_csv_string(const char gmx_unused *idstr, int gmx_unused *nid, int gmx_unused *idlist)
 {
     /* XXX implement cvs format to support more than 10 different GPUs in a box. */
     gmx_incons("Not implemented yet");
@@ -481,7 +481,7 @@ static int gmx_count_gpu_dev_unique(const gmx_gpu_info_t *gpu_info,
  * We assume that this is equal with the number of CPUs reported to be
  * online by the OS at the time of the call.
  */
-static int get_nthreads_hw_avail(FILE *fplog, const t_commrec *cr)
+static int get_nthreads_hw_avail(const t_commrec gmx_unused *cr)
 {
     int ret = 0;
 
@@ -530,8 +530,7 @@ static int get_nthreads_hw_avail(FILE *fplog, const t_commrec *cr)
     return ret;
 }
 
-static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr,
-                            gmx_gpu_info_t *gpu_info)
+static void gmx_detect_gpus(FILE *fplog, const t_commrec *cr)
 {
 #ifdef GMX_LIB_MPI
     int              rank_world;
@@ -634,7 +633,7 @@ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
         }
 
         /* detect number of hardware threads */
-        hwinfo_g->nthreads_hw_avail = get_nthreads_hw_avail(fplog, cr);
+        hwinfo_g->nthreads_hw_avail = get_nthreads_hw_avail(cr);
 
         /* detect GPUs */
         hwinfo_g->gpu_info.ncuda_dev            = 0;
@@ -649,7 +648,7 @@ gmx_hw_info_t *gmx_detect_hardware(FILE *fplog, const t_commrec *cr,
              getenv("GMX_DISABLE_GPU_DETECTION") == NULL);
         if (hwinfo_g->gpu_info.bDetectGPUs)
         {
-            gmx_detect_gpus(fplog, cr, &hwinfo_g->gpu_info);
+            gmx_detect_gpus(fplog, cr);
         }
     }
     /* increase the reference counter */
index 0f00f0c3d9640b50c94d758e997c81eb7d727c67..6ad8775e898867f8b2275fdde7c61378d5590f7e 100644 (file)
@@ -365,9 +365,11 @@ gmx_set_thread_affinity(FILE                *fplog,
  * Note that this will only work on Linux as we use a GNU feature.
  */
 void
-gmx_check_thread_affinity_set(FILE *fplog, const t_commrec *cr,
-                              gmx_hw_opt_t *hw_opt, int ncpus,
-                              gmx_bool bAfterOpenmpInit)
+gmx_check_thread_affinity_set(FILE            gmx_unused *fplog,
+                              const t_commrec gmx_unused *cr,
+                              gmx_hw_opt_t    gmx_unused *hw_opt,
+                              int             gmx_unused  ncpus,
+                              gmx_bool        gmx_unused  bAfterOpenmpInit)
 {
 #ifdef HAVE_SCHED_GETAFFINITY
     cpu_set_t mask_current;
index c857856bb0dfd244e2891b531c1cee42b22b6458..794f3cc84ac165d5d6f6334b7e825ee8b410caba 100644 (file)
@@ -733,7 +733,7 @@ float gmx_erfcf(float x)
 }
 
 
-gmx_bool gmx_isfinite(real x)
+gmx_bool gmx_isfinite(real gmx_unused x)
 {
     gmx_bool returnval = TRUE;
     /* If no suitable function was found, assume the value is
index 816161e42470ec276fb17ee32339741f7e5d2f68..fc991c82bc0d93cda644e90affbf89956cb0be66 100644 (file)
@@ -65,7 +65,7 @@ gmx_bool gmx_mpi_initialized(void)
 #endif
 }
 
-void gmx_fill_commrec_from_mpi(t_commrec *cr)
+void gmx_fill_commrec_from_mpi(t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_fill_commrec_from_mpi");
@@ -119,7 +119,7 @@ t_commrec *init_commrec()
     return cr;
 }
 
-t_commrec *reinitialize_commrec_for_this_thread(const t_commrec *cro)
+t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
 {
 #ifdef GMX_THREAD_MPI
     t_commrec *cr;
@@ -470,7 +470,7 @@ void gmx_init_intranode_counters(t_commrec *cr)
 }
 
 
-void gmx_barrier(const t_commrec *cr)
+void gmx_barrier(const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_barrier");
@@ -506,7 +506,7 @@ void gmx_abort(int gmx_unused noderank, int gmx_unused nnodes, int gmx_unused er
 #endif
 }
 
-void gmx_bcast(int nbytes, void *b, const t_commrec *cr)
+void gmx_bcast(int gmx_unused nbytes, void gmx_unused *b, const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_bast");
@@ -515,7 +515,7 @@ void gmx_bcast(int nbytes, void *b, const t_commrec *cr)
 #endif
 }
 
-void gmx_bcast_sim(int nbytes, void *b, const t_commrec *cr)
+void gmx_bcast_sim(int gmx_unused nbytes, void gmx_unused *b, const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_bast");
@@ -524,7 +524,7 @@ void gmx_bcast_sim(int nbytes, void *b, const t_commrec *cr)
 #endif
 }
 
-void gmx_sumd(int nr, double r[], const t_commrec *cr)
+void gmx_sumd(int gmx_unused nr, double gmx_unused r[], const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumd");
@@ -587,7 +587,7 @@ void gmx_sumd(int nr, double r[], const t_commrec *cr)
 #endif
 }
 
-void gmx_sumf(int nr, float r[], const t_commrec *cr)
+void gmx_sumf(int gmx_unused nr, float gmx_unused r[], const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumf");
@@ -649,7 +649,7 @@ void gmx_sumf(int nr, float r[], const t_commrec *cr)
 #endif
 }
 
-void gmx_sumi(int nr, int r[], const t_commrec *cr)
+void gmx_sumi(int gmx_unused nr, int gmx_unused r[], const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumi");
@@ -707,7 +707,7 @@ void gmx_sumi(int nr, int r[], const t_commrec *cr)
 #endif
 }
 
-void gmx_sumli(int nr, gmx_large_int_t r[], const t_commrec *cr)
+void gmx_sumli(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumli");
@@ -818,7 +818,7 @@ void gmx_sumf_comm(int nr, float r[], MPI_Comm mpi_comm)
 }
 #endif
 
-void gmx_sumd_sim(int nr, double r[], const gmx_multisim_t *ms)
+void gmx_sumd_sim(int gmx_unused nr, double gmx_unused r[], const gmx_multisim_t gmx_unused *ms)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumd_sim");
@@ -827,7 +827,7 @@ void gmx_sumd_sim(int nr, double r[], const gmx_multisim_t *ms)
 #endif
 }
 
-void gmx_sumf_sim(int nr, float r[], const gmx_multisim_t *ms)
+void gmx_sumf_sim(int gmx_unused nr, float gmx_unused r[], const gmx_multisim_t gmx_unused *ms)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumf_sim");
@@ -836,7 +836,7 @@ void gmx_sumf_sim(int nr, float r[], const gmx_multisim_t *ms)
 #endif
 }
 
-void gmx_sumi_sim(int nr, int r[], const gmx_multisim_t *ms)
+void gmx_sumi_sim(int gmx_unused nr, int gmx_unused r[], const gmx_multisim_t gmx_unused *ms)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumi_sim");
@@ -861,7 +861,7 @@ void gmx_sumi_sim(int nr, int r[], const gmx_multisim_t *ms)
 #endif
 }
 
-void gmx_sumli_sim(int nr, gmx_large_int_t r[], const gmx_multisim_t *ms)
+void gmx_sumli_sim(int gmx_unused nr, gmx_large_int_t gmx_unused r[], const gmx_multisim_t gmx_unused *ms)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_sumli_sim");
index cdb90ea6f7039efa8a1c278d5f1ba5e7e611d020..a993a450a09ebe69be0cf3ab89e9556d6de75bcf 100644 (file)
@@ -94,7 +94,7 @@ int get_current_gpu_device_id(void) FUNC_TERM_INT
 FUNC_QUALIFIER
 int get_gpu_device_id(const gmx_gpu_info_t gmx_unused *gpu_info,
                       const gmx_gpu_opt_t gmx_unused  *gpu_opt,
-                      int                              index) FUNC_TERM_INT
+                      int gmx_unused                   index) FUNC_TERM_INT
 
 FUNC_QUALIFIER
 void get_gpu_device_info_string(char gmx_unused *s, const gmx_gpu_info_t gmx_unused *gpu_info, int gmx_unused index) FUNC_TERM_VOID
index 5e2a60b4ead580b4076e9b0b3fdb2d97a98ed931..0e58da49b30a2bd92b53aed199f876352733b2fb 100644 (file)
@@ -5655,9 +5655,9 @@ static void make_load_communicator(gmx_domdec_t *dd, int dim_ind, ivec loc)
 }
 #endif
 
-void dd_setup_dlb_resource_sharing(t_commrec           *cr,
-                                   const gmx_hw_info_t *hwinfo,
-                                   const gmx_hw_opt_t  *hw_opt)
+void dd_setup_dlb_resource_sharing(t_commrec           gmx_unused *cr,
+                                   const gmx_hw_info_t gmx_unused *hwinfo,
+                                   const gmx_hw_opt_t  gmx_unused *hw_opt)
 {
 #ifdef GMX_MPI
     int           physicalnode_id_hash;
@@ -5711,7 +5711,7 @@ void dd_setup_dlb_resource_sharing(t_commrec           *cr,
 #endif
 }
 
-static void make_load_communicators(gmx_domdec_t *dd)
+static void make_load_communicators(gmx_domdec_t gmx_unused *dd)
 {
 #ifdef GMX_MPI
     int  dim0, dim1, i, j;
@@ -5916,7 +5916,7 @@ void setup_dd_grid(FILE *fplog, gmx_domdec_t *dd)
     }
 }
 
-static void make_pp_communicator(FILE *fplog, t_commrec *cr, int reorder)
+static void make_pp_communicator(FILE *fplog, t_commrec *cr, int gmx_unused reorder)
 {
     gmx_domdec_t      *dd;
     gmx_domdec_comm_t *comm;
@@ -6101,8 +6101,8 @@ static gmx_domdec_master_t *init_gmx_domdec_master_t(gmx_domdec_t *dd,
     return ma;
 }
 
-static void split_communicator(FILE *fplog, t_commrec *cr, int dd_node_order,
-                               int reorder)
+static void split_communicator(FILE *fplog, t_commrec *cr, int gmx_unused dd_node_order,
+                               int gmx_unused reorder)
 {
     gmx_domdec_t      *dd;
     gmx_domdec_comm_t *comm;
index f2cde6b101e03bbe04763806dd7be041a03cc6da..c298d1acc8320edbc6aade11dada837fc021e575 100644 (file)
 #define DDMASTERRANK(dd)   (dd->masterrank)
 
 
-void dd_sendrecv_int(const gmx_domdec_t *dd,
-                     int ddimind, int direction,
-                     int *buf_s, int n_s,
-                     int *buf_r, int n_r)
+void dd_sendrecv_int(const gmx_domdec_t gmx_unused *dd,
+                     int gmx_unused ddimind, int gmx_unused direction,
+                     int gmx_unused *buf_s, int gmx_unused n_s,
+                     int gmx_unused *buf_r, int gmx_unused n_r)
 {
 #ifdef GMX_MPI
     int        rank_s, rank_r;
@@ -61,10 +61,10 @@ void dd_sendrecv_int(const gmx_domdec_t *dd,
 #endif
 }
 
-void dd_sendrecv_real(const gmx_domdec_t *dd,
-                      int ddimind, int direction,
-                      real *buf_s, int n_s,
-                      real *buf_r, int n_r)
+void dd_sendrecv_real(const gmx_domdec_t gmx_unused *dd,
+                      int gmx_unused ddimind, int gmx_unused direction,
+                      real gmx_unused *buf_s, int gmx_unused n_s,
+                      real gmx_unused *buf_r, int gmx_unused n_r)
 {
 #ifdef GMX_MPI
     int        rank_s, rank_r;
@@ -93,10 +93,10 @@ void dd_sendrecv_real(const gmx_domdec_t *dd,
 #endif
 }
 
-void dd_sendrecv_rvec(const gmx_domdec_t *dd,
-                      int ddimind, int direction,
-                      rvec *buf_s, int n_s,
-                      rvec *buf_r, int n_r)
+void dd_sendrecv_rvec(const gmx_domdec_t gmx_unused *dd,
+                      int gmx_unused ddimind, int gmx_unused direction,
+                      rvec gmx_unused *buf_s, int gmx_unused n_s,
+                      rvec gmx_unused *buf_r, int gmx_unused n_r)
 {
 #ifdef GMX_MPI
     int        rank_s, rank_r;
@@ -125,12 +125,12 @@ void dd_sendrecv_rvec(const gmx_domdec_t *dd,
 #endif
 }
 
-void dd_sendrecv2_rvec(const gmx_domdec_t *dd,
-                       int ddimind,
-                       rvec *buf_s_fw, int n_s_fw,
-                       rvec *buf_r_fw, int n_r_fw,
-                       rvec *buf_s_bw, int n_s_bw,
-                       rvec *buf_r_bw, int n_r_bw)
+void dd_sendrecv2_rvec(const gmx_domdec_t gmx_unused *dd,
+                       int gmx_unused ddimind,
+                       rvec gmx_unused *buf_s_fw, int gmx_unused n_s_fw,
+                       rvec gmx_unused *buf_r_fw, int gmx_unused n_r_fw,
+                       rvec gmx_unused *buf_s_bw, int gmx_unused n_s_bw,
+                       rvec gmx_unused *buf_r_bw, int gmx_unused n_r_bw)
 {
 #ifdef GMX_MPI
     int         rank_fw, rank_bw, nreq;
@@ -200,7 +200,7 @@ void dd_sendrecv2_rvec(const gmx_domdec_t *dd,
  * called during DD setup and partition.
  */
 
-void dd_bcast(gmx_domdec_t *dd, int nbytes, void *data)
+void dd_bcast(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *data)
 {
 #ifdef GMX_MPI
 #ifdef GMX_BLUEGENE
@@ -234,7 +234,7 @@ void dd_bcastc(gmx_domdec_t *dd, int nbytes, void *src, void *dest)
 #endif
 }
 
-void dd_scatter(gmx_domdec_t *dd, int nbytes, void *src, void *dest)
+void dd_scatter(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *src, void gmx_unused *dest)
 {
 #ifdef GMX_MPI
     MPI_Scatter(src, nbytes, MPI_BYTE,
@@ -243,7 +243,7 @@ void dd_scatter(gmx_domdec_t *dd, int nbytes, void *src, void *dest)
 #endif
 }
 
-void dd_gather(gmx_domdec_t *dd, int nbytes, void *src, void *dest)
+void dd_gather(gmx_domdec_t gmx_unused *dd, int gmx_unused nbytes, void gmx_unused *src, void gmx_unused *dest)
 {
 #ifdef GMX_MPI
     MPI_Gather(src, nbytes, MPI_BYTE,
@@ -252,9 +252,9 @@ void dd_gather(gmx_domdec_t *dd, int nbytes, void *src, void *dest)
 #endif
 }
 
-void dd_scatterv(gmx_domdec_t *dd,
-                 int *scounts, int *disps, void *sbuf,
-                 int rcount, void *rbuf)
+void dd_scatterv(gmx_domdec_t gmx_unused *dd,
+                 int gmx_unused *scounts, int gmx_unused *disps, void gmx_unused *sbuf,
+                 int gmx_unused rcount, void gmx_unused *rbuf)
 {
 #ifdef GMX_MPI
     int dum;
@@ -270,9 +270,9 @@ void dd_scatterv(gmx_domdec_t *dd,
 #endif
 }
 
-void dd_gatherv(gmx_domdec_t *dd,
-                int scount, void *sbuf,
-                int *rcounts, int *disps, void *rbuf)
+void dd_gatherv(gmx_domdec_t gmx_unused *dd,
+                int gmx_unused scount, void gmx_unused *sbuf,
+                int gmx_unused *rcounts, int gmx_unused *disps, void gmx_unused *rbuf)
 {
 #ifdef GMX_MPI
     int dum;
index 067fcd1735aab24fae5a15dc106c9b0b892bbdc6..4263dc5d518079bcad73c0e4e6ac4c454ad7b4ef 100644 (file)
@@ -1780,7 +1780,7 @@ void init_interaction_const_tables(FILE                *fp,
 }
 
 static void init_interaction_const(FILE                 *fp,
-                                   const t_commrec      *cr,
+                                   const t_commrec gmx_unused *cr,
                                    interaction_const_t **interaction_const,
                                    const t_forcerec     *fr,
                                    real                  rtab)
index ffe72ab86f2eb77bfcd588ea50397858e67cc96c..0454f30be2facb61abb8c0f48b54e89680b7097b 100644 (file)
@@ -127,7 +127,7 @@ int init_gb_nblist(int natoms, t_nblist *nl)
     return 0;
 }
 
-void gb_pd_send(t_commrec *cr, real *send_data, int nr)
+void gb_pd_send(t_commrec gmx_unused *cr, real gmx_unused *send_data, int gmx_unused nr)
 {
 #ifdef GMX_MPI
     int  i, cur;
@@ -1648,7 +1648,7 @@ calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t
                                                fr->invsqrta, fr->dvda, fr->gbtab.data, idef, born->epsilon_r, born->gb_epsilon_solvent, fr->epsfac, pbc_null, graph);
 
     /* Calculate self corrections to the GB energies - currently only A state used! (FIXME) */
-    enerd->term[F_GBPOL]       += calc_gb_selfcorrections(cr, born->nr, md->chargeA, born, fr->dvda,fr->epsfac);
+    enerd->term[F_GBPOL]       += calc_gb_selfcorrections(cr, born->nr, md->chargeA, born, fr->dvda, fr->epsfac);
 
     /* If parallel, sum the derivative of the potential w.r.t the born radii */
     if (PARTDECOMP(cr))
index 9fa385e04c248a2effed70ac1c574abc0c219070..91a2ab02a56541095a80cc66daa143142a8a8593 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _nbnxn_kernel_simd_utils_h_
 #define _nbnxn_kernel_simd_utils_h_
 
+#include "gromacs/legacyheaders/types/simple.h"
+
 /*! \brief Provides hardware-specific utility routines for the SIMD kernels.
  *
  * Defines all functions, typedefs, constants and macros that have
@@ -81,7 +83,7 @@ static const int nbfp_stride = 4;
  * full-width AVX_256 use the array, but other implementations do
  * not. */
 static gmx_inline int *
-prepare_table_load_buffer(const int *array)
+prepare_table_load_buffer(const int gmx_unused *array)
 {
 #if defined GMX_X86_AVX_256 && !defined GMX_USE_HALF_WIDTH_SIMD_HERE
     return gmx_simd_align_int(array);
index 395f6eea077357b0c2e5f90155ea29efaaa8d24b..f866758218515c49e1bc8bfba5a9cfdbb6ed5292 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _nbnxn_kernel_simd_utils_x86_128d_h_
 #define _nbnxn_kernel_simd_utils_x86_128d_h_
 
+#include "gromacs/legacyheaders/types/simple.h"
+
 /* This files contains all functions/macros for the SIMD kernels
  * which have explicit dependencies on the j-cluster size and/or SIMD-width.
  * The functionality which depends on the j-cluster size is:
@@ -128,7 +130,7 @@ load_lj_pair_params(const real *nbfp, const int *type, int aj,
  * AVX_256. */
 
 static gmx_inline void
-load_table_f(const real *tab_coul_F, gmx_epi32 ti_S, int *ti,
+load_table_f(const real *tab_coul_F, gmx_epi32 ti_S, int gmx_unused *ti,
              __m128d *ctab0_S, __m128d *ctab1_S)
 {
     int     idx[2];
@@ -148,7 +150,7 @@ load_table_f(const real *tab_coul_F, gmx_epi32 ti_S, int *ti,
 
 static gmx_inline void
 load_table_f_v(const real *tab_coul_F, const real *tab_coul_V,
-               gmx_epi32 ti_S, int *ti,
+               gmx_epi32 ti_S, int gmx_unused *ti,
                __m128d *ctab0_S, __m128d *ctab1_S, __m128d *ctabv_S)
 {
     int     idx[2];
index 9509b6c5cb1f544d9045cd12b60aa30da996970e..02c6ca1a5b08b148e2f23cff7236288e63ed39f2 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef _nbnxn_kernel_simd_utils_x86_128s_h_
 #define _nbnxn_kernel_simd_utils_x86_128s_h_
 
+#include "gromacs/legacyheaders/types/simple.h"
+
 /* This files contains all functions/macros for the SIMD kernels
  * which have explicit dependencies on the j-cluster size and/or SIMD-width.
  * The functionality which depends on the j-cluster size is:
@@ -114,7 +116,7 @@ load_lj_pair_params(const real *nbfp, const int *type, int aj,
  * AVX_256. */
 
 static gmx_inline void
-load_table_f(const real *tab_coul_FDV0, gmx_epi32 ti_S, int *ti,
+load_table_f(const real *tab_coul_FDV0, gmx_epi32 ti_S, int gmx_unused *ti,
              __m128 *ctab0_S, __m128 *ctab1_S)
 {
     int    idx[4];
@@ -137,7 +139,7 @@ load_table_f(const real *tab_coul_FDV0, gmx_epi32 ti_S, int *ti,
 }
 
 static gmx_inline void
-load_table_f_v(const real *tab_coul_FDV0, gmx_epi32 ti_S, int *ti,
+load_table_f_v(const real *tab_coul_FDV0, gmx_epi32 ti_S, int gmx_unused *ti,
                __m128 *ctab0_S, __m128 *ctab1_S, __m128 *ctabv_S)
 {
     int    idx[4];
index 23101537023d6ff5fbfe02485853eac4b0ac3f19..d61a35b720d0c4eb433c0a5953b2a33e4dfe8a2f 100644 (file)
 #include "../nbnxn_kernel_simd_utils.h"
 
 static inline void
-gmx_load_simd_4xn_interactions(int            excl,
-                               gmx_exclfilter filter_S0,
-                               gmx_exclfilter filter_S1,
-                               gmx_exclfilter filter_S2,
-                               gmx_exclfilter filter_S3,
-                               const char    *interaction_mask_indices,
-                               real          *simd_interaction_array,
-                               gmx_mm_pb     *interact_S0,
-                               gmx_mm_pb     *interact_S1,
-                               gmx_mm_pb     *interact_S2,
-                               gmx_mm_pb     *interact_S3)
+gmx_load_simd_4xn_interactions(int                    excl,
+                               gmx_exclfilter         filter_S0,
+                               gmx_exclfilter         filter_S1,
+                               gmx_exclfilter         filter_S2,
+                               gmx_exclfilter         filter_S3,
+                               const char gmx_unused *interaction_mask_indices,
+                               real gmx_unused       *simd_interaction_array,
+                               gmx_mm_pb             *interact_S0,
+                               gmx_mm_pb             *interact_S1,
+                               gmx_mm_pb             *interact_S2,
+                               gmx_mm_pb             *interact_S3)
 {
 #ifdef GMX_X86_SSE2
     /* Load integer interaction mask */
index ca7bafa28704f76887668261be498b3fd8a23574..e66142f6a864edaf0707c27a404de786b8344e61 100644 (file)
@@ -552,7 +552,7 @@ static int set_grid_size_xy(const nbnxn_search_t nbs,
  * or easier, allocate at least n*SGSF elements.
  */
 static void sort_atoms(int dim, gmx_bool Backwards,
-                       int dd_zone,
+                       int gmx_unused dd_zone,
                        int *a, int n, rvec *x,
                        real h0, real invh, int n_per_h,
                        int *sort)
@@ -877,7 +877,7 @@ static void calc_bounding_box_simd4(int na, const float *x, nbnxn_bb_t *bb)
     gmx_simd4_pr bb_0_S, bb_1_S;
     gmx_simd4_pr x_S;
 
-    int    i;
+    int          i;
 
     bb_0_S = gmx_simd4_load_bb_pr(x);
     bb_1_S = bb_0_S;
@@ -2096,7 +2096,7 @@ static float subc_bb_dist2_simd4(int si, const nbnxn_bb_t *bb_i_ci,
 /* Calculate bb bounding distances of bb_i[si,...,si+3] and store them in d2 */
 #define SUBC_BB_DIST2_SIMD4_XXXX_INNER(si, bb_i, d2) \
     {                                                \
-        int    shi;                                  \
+        int          shi;                                  \
                                                  \
         gmx_simd4_pr dx_0, dy_0, dz_0;                       \
         gmx_simd4_pr dx_1, dy_1, dz_1;                       \
@@ -2231,8 +2231,8 @@ static gmx_bool subc_in_range_simd4(int na_c,
 
     gmx_simd4_pr rc2_S;
 
-    int    dim_stride;
-    int    j0, j1;
+    int          dim_stride;
+    int          j0, j1;
 
     rc2_S   = gmx_simd4_set1_pr(rl2);
 
@@ -2944,7 +2944,7 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
 #ifdef NBNXN_BBXXXX
         /* Determine all ci1 bb distances in one call with SIMD4 */
         subc_bb_dist2_simd4_xxxx(gridj->pbb+(cj>>STRIDE_PBB_2LOG)*NNBSBB_XXXX+(cj & (STRIDE_PBB-1)),
-                               ci1, pbb_ci, d2l);
+                                 ci1, pbb_ci, d2l);
         *ndistc += na_c*2;
 #endif
 
index b16963b085d4fd3210d5273b6554421a6b4b0003..2ddc660fba7ba4c9fea9342db3f4e97cc3f6138c 100644 (file)
@@ -91,7 +91,7 @@ typedef struct gmx_partdec {
 } gmx_partdec_t;
 
 
-void gmx_tx(const t_commrec *cr, int dir, void *buf, int bufsize)
+void gmx_tx(const t_commrec gmx_unused *cr, int gmx_unused dir, void gmx_unused *buf, int gmx_unused bufsize)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_tx");
@@ -127,7 +127,7 @@ void gmx_tx(const t_commrec *cr, int dir, void *buf, int bufsize)
 #endif
 }
 
-void gmx_tx_wait(const t_commrec *cr)
+void gmx_tx_wait(const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_tx_wait");
@@ -142,7 +142,7 @@ void gmx_tx_wait(const t_commrec *cr)
 #endif
 }
 
-void gmx_rx(const t_commrec *cr, int dir, void *buf, int bufsize)
+void gmx_rx(const t_commrec gmx_unused *cr, int gmx_unused dir, void gmx_unused *buf, int gmx_unused bufsize)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_rx");
@@ -163,7 +163,7 @@ void gmx_rx(const t_commrec *cr, int dir, void *buf, int bufsize)
 #endif
 }
 
-void gmx_rx_wait(const t_commrec *cr)
+void gmx_rx_wait(const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_rx_wait");
@@ -178,9 +178,9 @@ void gmx_rx_wait(const t_commrec *cr)
 #endif
 }
 
-void gmx_tx_rx_real(const t_commrec *cr,
-                    int send_dir, real *send_buf, int send_bufsize,
-                    int recv_dir, real *recv_buf, int recv_bufsize)
+void gmx_tx_rx_real(const t_commrec gmx_unused *cr,
+                    int gmx_unused send_dir, real gmx_unused *send_buf, int gmx_unused send_bufsize,
+                    int gmx_unused recv_dir, real gmx_unused *recv_buf, int gmx_unused recv_bufsize)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_tx_rx_real");
@@ -219,9 +219,9 @@ void gmx_tx_rx_real(const t_commrec *cr,
 }
 
 
-void gmx_tx_rx_void(const t_commrec *cr,
-                    int send_dir, void *send_buf, int send_bufsize,
-                    int recv_dir, void *recv_buf, int recv_bufsize)
+void gmx_tx_rx_void(const t_commrec gmx_unused *cr,
+                    int gmx_unused send_dir, void gmx_unused *send_buf, int gmx_unused send_bufsize,
+                    int gmx_unused recv_dir, void gmx_unused *recv_buf, int gmx_unused recv_bufsize)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_tx_rx_void");
@@ -244,7 +244,7 @@ void gmx_tx_rx_void(const t_commrec *cr,
 
 /*void gmx_wait(int dir_send,int dir_recv)*/
 
-void gmx_wait(const t_commrec *cr)
+void gmx_wait(const t_commrec gmx_unused *cr)
 {
 #ifndef GMX_MPI
     gmx_call("gmx_wait");
@@ -333,9 +333,9 @@ pd_constraints_nlocalatoms(gmx_partdec_p_t pd)
  * This has not been tested for periodic molecules...
  */
 void
-pd_move_x_constraints(t_commrec *  cr,
-                      rvec *       x0,
-                      rvec *       x1)
+pd_move_x_constraints(t_commrec gmx_unused *cr,
+                      rvec      gmx_unused *x0,
+                      rvec      gmx_unused *x1)
 {
 #ifdef GMX_MPI
     gmx_partdec_t            *pd;
@@ -953,7 +953,7 @@ gmx_bool setup_parallel_vsites(t_idef *idef, t_commrec *cr,
     return do_comm;
 }
 
-t_state *partdec_init_local_state(t_commrec *cr, t_state *state_global)
+t_state *partdec_init_local_state(t_commrec gmx_unused *cr, t_state *state_global)
 {
     int      i;
     t_state *state_local;
index 8683ca687a1dc00f33f0b7cc906278617813bf9e..60079b0781e97753118308a5d1caa1447e8a9025 100644 (file)
@@ -662,9 +662,9 @@ static void pme_realloc_atomcomm_things(pme_atomcomm_t *atc)
     }
 }
 
-static void pmeredist_pd(gmx_pme_t pme, gmx_bool forw,
-                         int n, gmx_bool bXF, rvec *x_f, real *charge,
-                         pme_atomcomm_t *atc)
+static void pmeredist_pd(gmx_pme_t pme, gmx_bool gmx_unused forw,
+                         int n, gmx_bool gmx_unused bXF, rvec gmx_unused *x_f,
+                         real gmx_unused *charge, pme_atomcomm_t *atc)
 /* Redistribute particle data for PME calculation */
 /* domain decomposition by x coordinate           */
 {
@@ -773,10 +773,10 @@ static void pmeredist_pd(gmx_pme_t pme, gmx_bool forw,
 #endif
 }
 
-static void pme_dd_sendrecv(pme_atomcomm_t *atc,
-                            gmx_bool bBackward, int shift,
-                            void *buf_s, int nbyte_s,
-                            void *buf_r, int nbyte_r)
+static void pme_dd_sendrecv(pme_atomcomm_t gmx_unused *atc,
+                            gmx_bool gmx_unused bBackward, int gmx_unused shift,
+                            void gmx_unused *buf_s, int gmx_unused nbyte_s,
+                            void gmx_unused *buf_r, int gmx_unused nbyte_r)
 {
 #ifdef GMX_MPI
     int        dest, src;
index f84c07983ca2bc7f02b5f9e1858c116221e30417..d56cc52dbfbe6adc82b29053ff3a75b8905aed6d 100644 (file)
@@ -109,7 +109,7 @@ typedef struct {
 
 
 
-gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr)
+gmx_pme_pp_t gmx_pme_pp_init(t_commrec gmx_unused *cr)
 {
     struct gmx_pme_pp *pme_pp;
     int                rank;
@@ -133,7 +133,7 @@ gmx_pme_pp_t gmx_pme_pp_init(t_commrec *cr)
 /* This should be faster with a real non-blocking MPI implementation */
 /* #define GMX_PME_DELAYED_WAIT */
 
-static void gmx_pme_send_q_x_wait(gmx_domdec_t *dd)
+static void gmx_pme_send_q_x_wait(gmx_domdec_t gmx_unused *dd)
 {
 #ifdef GMX_MPI
     if (dd->nreq_pme)
@@ -145,8 +145,8 @@ static void gmx_pme_send_q_x_wait(gmx_domdec_t *dd)
 }
 
 static void gmx_pme_send_q_x(t_commrec *cr, int flags,
-                             real *chargeA, real *chargeB,
-                             matrix box, rvec *x,
+                             real gmx_unused *chargeA, real gmx_unused *chargeB,
+                             matrix box, rvec gmx_unused *x,
                              real lambda,
                              int maxshift_x, int maxshift_y,
                              gmx_large_int_t step)
@@ -284,7 +284,7 @@ void gmx_pme_send_finish(t_commrec *cr)
     gmx_pme_send_q_x(cr, flags, NULL, NULL, NULL, NULL, 0, 0, 0, -1);
 }
 
-void gmx_pme_send_switchgrid(t_commrec *cr, ivec grid_size, real ewaldcoeff)
+void gmx_pme_send_switchgrid(t_commrec gmx_unused *cr, ivec gmx_unused grid_size, real gmx_unused ewaldcoeff)
 {
 #ifdef GMX_MPI
     gmx_pme_comm_n_box_t cnb;
@@ -303,7 +303,7 @@ void gmx_pme_send_switchgrid(t_commrec *cr, ivec grid_size, real ewaldcoeff)
 #endif
 }
 
-void gmx_pme_send_resetcounters(t_commrec *cr, gmx_large_int_t step)
+void gmx_pme_send_resetcounters(t_commrec gmx_unused *cr, gmx_large_int_t gmx_unused step)
 {
 #ifdef GMX_MPI
     gmx_pme_comm_n_box_t cnb;
@@ -324,12 +324,12 @@ void gmx_pme_send_resetcounters(t_commrec *cr, gmx_large_int_t step)
 int gmx_pme_recv_q_x(struct gmx_pme_pp *pme_pp,
                      int *natoms,
                      real **chargeA, real **chargeB,
-                     matrix box, rvec **x, rvec **f,
-                     int *maxshift_x, int *maxshift_y,
-                     gmx_bool *bFreeEnergy, real *lambda,
-                     gmx_bool *bEnerVir,
-                     gmx_large_int_t *step,
-                     ivec grid_size, real *ewaldcoeff)
+                     matrix gmx_unused box, rvec **x, rvec **f,
+                     int gmx_unused *maxshift_x, int gmx_unused *maxshift_y,
+                     gmx_bool gmx_unused *bFreeEnergy, real gmx_unused *lambda,
+                     gmx_bool gmx_unused *bEnerVir,
+                     gmx_large_int_t gmx_unused *step,
+                     ivec gmx_unused grid_size, real gmx_unused *ewaldcoeff)
 {
     gmx_pme_comm_n_box_t cnb;
     int                  nat = 0, q, messages, sender;
@@ -587,7 +587,7 @@ void gmx_pme_receive_f(t_commrec *cr,
 }
 
 void gmx_pme_send_force_vir_ener(struct gmx_pme_pp *pme_pp,
-                                 rvec *f, matrix vir,
+                                 rvec gmx_unused *f, matrix vir,
                                  real energy, real dvdlambda,
                                  float cycles)
 {
index 7d1730b6e7903fffcfccc2f22ac9ad02fceec2c1..a057f2d4bd41024eed3b7cbbea7f2a6a25b6276d 100644 (file)
@@ -117,7 +117,7 @@ gmx_bool wallcycle_have_counter(void)
     return gmx_cycles_have_counter();
 }
 
-gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec *cr,
+gmx_wallcycle_t wallcycle_init(FILE *fplog, int resetstep, t_commrec gmx_unused *cr,
                                int nthreads_pp, int nthreads_pme)
 {
     gmx_wallcycle_t wc;
@@ -863,7 +863,11 @@ void wallcycle_sub_stop(gmx_wallcycle_t wc, int ewcs)
 
 #else
 
-void wallcycle_sub_start(gmx_wallcycle_t gmx_unused wc, int gmx_unused ewcs) {}
-void wallcycle_sub_stop(gmx_wallcycle_t gmx_unused wc, int gmx_unused ewcs) {}
+void wallcycle_sub_start(gmx_wallcycle_t gmx_unused wc, int gmx_unused ewcs)
+{
+}
+void wallcycle_sub_stop(gmx_wallcycle_t gmx_unused wc, int gmx_unused ewcs)
+{
+}
 
 #endif /* GMX_CYCLE_SUBCOUNTERS */
similarity index 87%
rename from src/gromacs/utility/gmxomp.c
rename to src/gromacs/utility/gmxomp.cpp
index 8f12bb8985df8cd3fb36887d6d0e2906a5459b01..768034c9751586a44bab58ef4a0e5569dbd9f04f 100644 (file)
@@ -53,6 +53,8 @@
 #include "statutil.h"
 #include "string2.h"
 
+#include "common.h"
+
 int gmx_omp_get_max_threads(void)
 {
 #ifdef GMX_OPENMP
@@ -85,7 +87,7 @@ void gmx_omp_set_num_threads(int num_threads)
 #ifdef GMX_OPENMP
     omp_set_num_threads(num_threads);
 #else
-    return;
+    GMX_UNUSED_VALUE(num_threads);
 #endif
 }
 
@@ -108,34 +110,45 @@ void gmx_omp_set_num_threads(int num_threads)
  * when the first call is made into a compilation unit that contains OpenMP
  * pragmas.
  */
-void gmx_omp_check_thread_affinity(FILE *fplog, const t_commrec *cr,
-                                   gmx_hw_opt_t *hw_opt)
+void gmx_omp_check_thread_affinity(FILE            *fplog,
+                                   const t_commrec *cr,
+                                   gmx_hw_opt_t    *hw_opt)
 {
-    gmx_bool bKmpAffinitySet, bGompCpuAffinitySet;
-    char    *kmp_env, *gomp_env;
-
     /* no need to worry if internal thread pinning is turned off */
     if (hw_opt->thread_affinity == threadaffOFF)
     {
         return;
     }
 
-#if defined(GMX_OPENMP)
-
+#ifndef GMX_OPENMP
+    GMX_UNUSED_VALUE(fplog);
+    GMX_UNUSED_VALUE(cr);
+#else
     /* We assume that the affinity setting is available on all platforms
      * gcc supports. Even if this is not the case (e.g. Mac OS) the user
-     * will only get a warning.*/
-    bGompCpuAffinitySet = FALSE;
-    gomp_env            = NULL;
-#if defined(__GNUC__)
-    gomp_env            = getenv("GOMP_CPU_AFFINITY");
-    bGompCpuAffinitySet = (gomp_env != NULL);
-#endif /* __GNUC__ */
-
-    bKmpAffinitySet = FALSE;
+     * will only get a warning. */
+#if defined(__GNUC__) || defined(__INTEL_COMPILER)
+    const char *const gomp_env            = getenv("GOMP_CPU_AFFINITY");
+    const bool        bGompCpuAffinitySet = (gomp_env != NULL);
+
+    /* turn off internal pinning if GOMP_CPU_AFFINITY is set & non-empty */
+    if (bGompCpuAffinitySet && *gomp_env != '\0')
+    {
+        /* TODO: with -pin auto we should only warn when using all cores */
+        md_print_warn(cr, fplog,
+                      "NOTE: GOMP_CPU_AFFINITY set, will turn off %s internal affinity\n"
+                      "      setting as the two can conflict and cause performance degradation.\n"
+                      "      To keep using the %s internal affinity setting, unset the\n"
+                      "      GOMP_CPU_AFFINITY environment variable.",
+                      ShortProgram(), ShortProgram());
+
+        hw_opt->thread_affinity = threadaffOFF;
+    }
+#endif /* __GNUC__ || __INTEL_COMPILER */
+
 #if defined(__INTEL_COMPILER)
-    kmp_env         = getenv("KMP_AFFINITY");
-    bKmpAffinitySet = (kmp_env != NULL);
+    const char *const kmp_env         = getenv("KMP_AFFINITY");
+    const bool        bKmpAffinitySet = (kmp_env != NULL);
 
     /* disable Intel OpenMP affinity if neither KMP_AFFINITY nor
      * GOMP_CPU_AFFINITY is set (Intel uses the GNU env. var as well) */
@@ -177,21 +190,5 @@ void gmx_omp_check_thread_affinity(FILE *fplog, const t_commrec *cr,
     }
 #endif /* __INTEL_COMPILER */
 
-#if defined(__INTEL_COMPILER) || defined(__GNUC__)
-    /* turn off internal pinning f GOMP_CPU_AFFINITY is set & non-empty */
-    if (bGompCpuAffinitySet && gomp_env != NULL && gomp_env != '\0')
-    {
-        /* TODO: with -pin auto we should only warn when using all cores */
-        md_print_warn(cr, fplog,
-                      "NOTE: GOMP_CPU_AFFINITY set, will turn off %s internal affinity\n"
-                      "      setting as the two can conflict and cause performance degradation.\n"
-                      "      To keep using the %s internal affinity setting, unset the\n"
-                      "      GOMP_CPU_AFFINITY environment variable.",
-                      ShortProgram(), ShortProgram());
-
-        hw_opt->thread_affinity = threadaffOFF;
-    }
-#endif /* __INTEL_COMPILER || __GNUC__ */
-
 #endif /* GMX_OPENMP */
 }
index a34a624254be56c4df98eee89af83b9dfb976347..f124697d0578a7001c125b83686126f26e3a9c65 100644 (file)
@@ -396,7 +396,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
     return re;
 }
 
-static void exchange_reals(const gmx_multisim_t *ms, int b, real *v, int n)
+static void exchange_reals(const gmx_multisim_t gmx_unused *ms, int gmx_unused b, real *v, int n)
 {
     real *buf;
     int   i;
@@ -429,7 +429,7 @@ static void exchange_reals(const gmx_multisim_t *ms, int b, real *v, int n)
 }
 
 
-static void exchange_ints(const gmx_multisim_t *ms, int b, int *v, int n)
+static void exchange_ints(const gmx_multisim_t gmx_unused *ms, int gmx_unused b, int *v, int n)
 {
     int *buf;
     int  i;
@@ -461,7 +461,7 @@ static void exchange_ints(const gmx_multisim_t *ms, int b, int *v, int n)
     }
 }
 
-static void exchange_doubles(const gmx_multisim_t *ms, int b, double *v, int n)
+static void exchange_doubles(const gmx_multisim_t gmx_unused *ms, int gmx_unused b, double *v, int n)
 {
     double *buf;
     int     i;
@@ -493,7 +493,7 @@ static void exchange_doubles(const gmx_multisim_t *ms, int b, double *v, int n)
     }
 }
 
-static void exchange_rvecs(const gmx_multisim_t *ms, int b, rvec *v, int n)
+static void exchange_rvecs(const gmx_multisim_t gmx_unused *ms, int gmx_unused b, rvec *v, int n)
 {
     rvec *buf;
     int   i;
index 43a649a88bf7b56258840a2bee234e96c768367b..f43fa0fb34cbb8ed8f304aa0190fdb53f1909190 100644 (file)
@@ -646,7 +646,6 @@ static void increase_nstlist(FILE *fp, t_commrec *cr,
 }
 
 static void prepare_verlet_scheme(FILE                           *fplog,
-                                  const gmx_hw_info_t            *hwinfo,
                                   t_commrec                      *cr,
                                   t_inputrec                     *ir,
                                   const gmx_mtop_t               *mtop,
@@ -1008,7 +1007,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
              const char *ddcsx, const char *ddcsy, const char *ddcsz,
              const char *nbpu_opt,
              gmx_large_int_t nsteps_cmdline, int nstepout, int resetstep,
-             int nmultisim, int repl_ex_nst, int repl_ex_nex,
+             int gmx_unused nmultisim, int repl_ex_nst, int repl_ex_nex,
              int repl_ex_seed, real pforce, real cpt_period, real max_hours,
              const char *deviceOptions, unsigned long Flags)
 {
@@ -1082,7 +1081,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
             bUseGPU = (hwinfo->gpu_info.ncuda_dev_compatible > 0 ||
                        getenv("GMX_EMULATE_GPU") != NULL);
 
-            prepare_verlet_scheme(fplog, hwinfo, cr,
+            prepare_verlet_scheme(fplog, cr,
                                   inputrec, mtop, state->box,
                                   bUseGPU);
         }