mdlib: Clean up -Wunused-parameter warnings
authorAlexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
Thu, 26 Sep 2013 08:00:32 +0000 (12:00 +0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 29 Oct 2013 19:10:49 +0000 (20:10 +0100)
Change-Id: I555d418ca21e03ba891b0cf9f9eebbe2fb19a316

src/gromacs/mdlib/nbnxn_atomdata.c
src/gromacs/mdlib/nbnxn_search.c
src/gromacs/mdlib/pme.c

index 77cc522c017130d8b8accab49b41ee12fdab3cdb..262d1f08c7a07c6ab2cbd8bb07f18640ed957c7c 100644 (file)
@@ -1117,11 +1117,11 @@ nbnxn_atomdata_reduce_reals(real * gmx_restrict dest,
 }
 
 static void
-nbnxn_atomdata_reduce_reals_simd(real * gmx_restrict dest,
-                                 gmx_bool bDestSet,
-                                 real ** gmx_restrict src,
-                                 int nsrc,
-                                 int i0, int i1)
+nbnxn_atomdata_reduce_reals_simd(real gmx_unused * gmx_restrict dest,
+                                 gmx_bool gmx_unused bDestSet,
+                                 real gmx_unused ** gmx_restrict src,
+                                 int gmx_unused nsrc,
+                                 int gmx_unused i0, int gmx_unused i1)
 {
 #ifdef GMX_NBNXN_SIMD
 /* The SIMD width here is actually independent of that in the kernels,
index 84cd9c322465d4d165e85f852d73ad1aa6f5626f..934773a7817801627b75d68b8b46a3e30075cedb 100644 (file)
@@ -1111,10 +1111,10 @@ void fill_cell(const nbnxn_search_t nbs,
                const int *atinfo,
                rvec *x,
                int sx, int sy, int sz,
-               nbnxn_bb_t *bb_work_aligned)
+               nbnxn_bb_t gmx_unused *bb_work_aligned)
 {
-    int        na, a;
-    size_t     offset;
+    int         na, a;
+    size_t      offset;
     nbnxn_bb_t *bb_ptr;
 #ifdef NBNXN_BBXXXX
     float      *pbb_ptr;
@@ -2207,7 +2207,6 @@ gmx_simd4_calc_rsq_pr(gmx_simd4_pr x, gmx_simd4_pr y, gmx_simd4_pr z)
 {
     return gmx_simd4_add_pr( gmx_simd4_add_pr( gmx_simd4_mul_pr(x, x), gmx_simd4_mul_pr(y, y) ), gmx_simd4_mul_pr(z, z) );
 }
-#endif
 
 /* 4-wide SIMD function which determines if any atom pair between two cells,
  * both with 8 atoms, is within distance sqrt(rl2).
@@ -2218,7 +2217,6 @@ static gmx_bool subc_in_range_simd4(int na_c,
                                     int csj, int stride, const real *x_j,
                                     real rl2)
 {
-#ifdef NBNXN_SEARCH_SIMD4_FLOAT_X_BB
     gmx_simd4_pr ix_S0, iy_S0, iz_S0;
     gmx_simd4_pr ix_S1, iy_S1, iz_S1;
 
@@ -2310,13 +2308,9 @@ static gmx_bool subc_in_range_simd4(int na_c,
     }
     return FALSE;
 
-#else
-    /* No SIMD4 */
-    gmx_incons("SIMD4 function called without 4-wide SIMD support");
-
-    return TRUE;
-#endif
 }
+#endif
+
 
 /* Returns the j sub-cell for index cj_ind */
 static int nbl_cj(const nbnxn_pairlist_t *nbl, int cj_ind)
@@ -2885,20 +2879,20 @@ static void make_cluster_list_supersub(const nbnxn_grid_t *gridi,
                                        real rl2, float rbb2,
                                        int *ndistc)
 {
-    int          na_c;
-    int          npair;
-    int          cjo, ci1, ci, cj, cj_gl;
-    int          cj4_ind, cj_offset;
-    unsigned     imask;
-    nbnxn_cj4_t *cj4;
+    int               na_c;
+    int               npair;
+    int               cjo, ci1, ci, cj, cj_gl;
+    int               cj4_ind, cj_offset;
+    unsigned          imask;
+    nbnxn_cj4_t      *cj4;
 #ifdef NBNXN_BBXXXX
     const float      *pbb_ci;
 #else
     const nbnxn_bb_t *bb_ci;
 #endif
-    const real  *x_ci;
-    float       *d2l, d2;
-    int          w;
+    const real       *x_ci;
+    float            *d2l, d2;
+    int               w;
 #define PRUNE_LIST_CPU_ONE
 #ifdef PRUNE_LIST_CPU_ONE
     int  ci_last = -1;
@@ -4183,9 +4177,9 @@ static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
     gmx_bool bMakeList;
     real shx, shy, shz;
     int  conv_i, cell0_i;
-    const nbnxn_bb_t *bb_i=NULL;
+    const nbnxn_bb_t *bb_i = NULL;
 #ifdef NBNXN_BBXXXX
-    const float *pbb_i=NULL;
+    const float *pbb_i = NULL;
 #endif
     const float *bbcz_i, *bbcz_j;
     const int *flags_i;
index 412b7170c0324eb89c0c28c985c38621000b864c..4df56633148f00942f821c3ef0fbc9940c758794 100644 (file)
@@ -1458,9 +1458,10 @@ unwrap_periodic_pmegrid(gmx_pme_t pme, real *pmegrid)
     }
 
 
-static void spread_q_bsplines_thread(pmegrid_t *pmegrid,
-                                     pme_atomcomm_t *atc, splinedata_t *spline,
-                                     pme_spline_work_t *work)
+static void spread_q_bsplines_thread(pmegrid_t                    *pmegrid,
+                                     pme_atomcomm_t               *atc,
+                                     splinedata_t                 *spline,
+                                     pme_spline_work_t gmx_unused *work)
 {
 
     /* spread charges from home atoms to local grid */
@@ -1548,7 +1549,7 @@ static void spread_q_bsplines_thread(pmegrid_t *pmegrid,
     }
 }
 
-static void set_grid_alignment(int *pmegrid_nz, int pme_order)
+static void set_grid_alignment(int gmx_unused *pmegrid_nz, int gmx_unused pme_order)
 {
 #ifdef PME_SIMD4_SPREAD_GATHER
     if (pme_order == 5
@@ -1879,7 +1880,7 @@ static void free_work(pme_work_t *work)
 
 #ifdef PME_SIMD
 /* Calculate exponentials through SIMD */
-inline static void calc_exponentials(int start, int end, real f, real *d_aligned, real *r_aligned, real *e_aligned)
+inline static void calc_exponentials(int gmx_unused start, int end, real f, real *d_aligned, real *r_aligned, real *e_aligned)
 {
     {
         const gmx_mm_pr two = gmx_set1_pr(2.0);
@@ -1888,6 +1889,9 @@ inline static void calc_exponentials(int start, int end, real f, real *d_aligned
         gmx_mm_pr tmp_d1, d_inv, tmp_r, tmp_e;
         int kx;
         f_simd = gmx_set1_pr(f);
+        /* We only need to calculate from start. But since start is 0 or 1
+         * and we want to use aligned loads/stores, we always start from 0.
+         */
         for (kx = 0; kx < end; kx += GMX_SIMD_WIDTH_HERE)
         {
             tmp_d1   = gmx_load_pr(d_aligned+kx);
@@ -2016,6 +2020,7 @@ static int solve_pme_yzx(gmx_pme_t pme, t_complex *grid,
         p0 = grid + iy*local_size[ZZ]*local_size[XX] + iz*local_size[XX];
 
         /* We should skip the k-space point (0,0,0) */
+        /* Note that since here x is the minor index, local_offset[XX]=0 */
         if (local_offset[XX] > 0 || ky > 0 || kz > 0)
         {
             kxstart = local_offset[XX];
@@ -2987,7 +2992,7 @@ make_gridindex5_to_localindex(int n, int local_start, int local_range,
     *fraction_shift  = fsh;
 }
 
-static pme_spline_work_t *make_pme_spline_work(int order)
+static pme_spline_work_t *make_pme_spline_work(int gmx_unused order)
 {
     pme_spline_work_t *work;