From: Andrey Alekseenko Date: Wed, 9 Jun 2021 19:40:38 +0000 (+0300) Subject: Remove some unused-but-set variables X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=08f82aa5dc7eca3c19f7c5d6c252c77523133c9b;p=alexxy%2Fgromacs.git Remove some unused-but-set variables Detected by the -Wunused-but-set-variable option in the open-source IntelLLVM (and, in theory, upstream Clang trunk). There are also false-positive warnings there, so the compilation log is noisy. I'm not doing any silencing here, since it will, hopefully, change by the time of Clang 13 release. But the variables removed here appear to be genuinely unused. --- diff --git a/src/gromacs/domdec/nsgrid.cpp b/src/gromacs/domdec/nsgrid.cpp index 8506189d68..0677c0a9f5 100644 --- a/src/gromacs/domdec/nsgrid.cpp +++ b/src/gromacs/domdec/nsgrid.cpp @@ -125,7 +125,7 @@ void get_nsgrid_boundaries(int nboundeddim, rvec grid_x1) { rvec av, stddev; - real vol, bdens0, bdens1; + real bdens0, bdens1; int d; if (nboundeddim < DIM) @@ -133,14 +133,12 @@ void get_nsgrid_boundaries(int nboundeddim, calc_x_av_stddev(ncg, cgcm, av, stddev); } - vol = 1; for (d = 0; d < DIM; d++) { if (d < nboundeddim) { grid_x0[d] = (gr0 != nullptr ? (*gr0)[d] : 0); grid_x1[d] = (gr1 != nullptr ? (*gr1)[d] : box[d][d]); - vol *= (grid_x1[d] - grid_x0[d]); } else { @@ -171,7 +169,6 @@ void get_nsgrid_boundaries(int nboundeddim, grid_x1[d] = (*gr1)[d]; bdens1 = (*gr1)[d]; } - vol *= (bdens1 - bdens0); } if (debug) diff --git a/src/gromacs/ewald/pme_only.cpp b/src/gromacs/ewald/pme_only.cpp index aa3263aaf1..50f5b48878 100644 --- a/src/gromacs/ewald/pme_only.cpp +++ b/src/gromacs/ewald/pme_only.cpp @@ -260,9 +260,8 @@ static int gmx_pme_recv_coeffs_coords(struct gmx_pme_t* pme, int nat = 0; #if GMX_MPI - unsigned int flags = 0; - int messages = 0; - bool atomSetChanged = false; + int messages = 0; + bool atomSetChanged = false; do { @@ -272,9 +271,6 @@ static int gmx_pme_recv_coeffs_coords(struct gmx_pme_t* pme, /* Receive the send count, box and time step from the peer PP node */ MPI_Recv(&cnb, sizeof(cnb), MPI_BYTE, pme_pp->peerRankId, eCommType_CNB, pme_pp->mpi_comm_mysim, MPI_STATUS_IGNORE); - /* We accumulate all received flags */ - flags |= cnb.flags; - *step = cnb.step; if (debug) diff --git a/src/gromacs/gmxpreprocess/topio.cpp b/src/gromacs/gmxpreprocess/topio.cpp index 42cfc07583..714b8680ea 100644 --- a/src/gromacs/gmxpreprocess/topio.cpp +++ b/src/gromacs/gmxpreprocess/topio.cpp @@ -1379,8 +1379,7 @@ void generate_qmexcl(gmx_mtop_t* sys, t_inputrec* ir, const gmx::MDLogger& logge int mol, nat_mol, nr_mol_with_qm_atoms = 0; gmx_molblock_t* molb; bool bQMMM; - int index_offset = 0; - int qm_nr = 0; + int qm_nr = 0; grpnr = sys->groups.groupNumbers[SimulationAtomGroupType::QuantumMechanics].data(); @@ -1453,7 +1452,6 @@ void generate_qmexcl(gmx_mtop_t* sys, t_inputrec* ir, const gmx::MDLogger& logge { grpnr += nat_mol; } - index_offset += nat_mol; } } } diff --git a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h index bdf2524e51..620a6d5353 100644 --- a/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h +++ b/src/gromacs/nbnxm/kernels_simd_2xmm/kernel_outer.h @@ -332,7 +332,6 @@ const nbnxn_cj_t* l_cj = nbl->cj.data(); - int ninner = 0; for (const nbnxn_ci_t& ciEntry : nbl->ci) { const int ish = (ciEntry.shift & NBNXN_CI_SHIFT); @@ -587,8 +586,6 @@ } } #undef CALC_LJ - ninner += cjind1 - cjind0; - /* Add accumulated i-forces to the force array */ real fShiftX = reduceIncr4ReturnSumHsimd(f + scix, fix_S0, fix_S2); real fShiftY = reduceIncr4ReturnSumHsimd(f + sciy, fiy_S0, fiy_S2); diff --git a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h index 2af0345368..dae206ba69 100644 --- a/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h +++ b/src/gromacs/nbnxm/kernels_simd_4xm/kernel_outer.h @@ -352,8 +352,6 @@ const nbnxn_cj_t* l_cj = nbl->cj.data(); - int ninner = 0; - for (const nbnxn_ci_t& ciEntry : nbl->ci) { const int ish = (ciEntry.shift & NBNXN_CI_SHIFT); @@ -631,8 +629,6 @@ } } #undef CALC_LJ - ninner += cjind1 - cjind0; - /* Add accumulated i-forces to the force array */ real fShiftX = reduceIncr4ReturnSum(f + scix, fix_S0, fix_S1, fix_S2, fix_S3); real fShiftY = reduceIncr4ReturnSum(f + sciy, fiy_S0, fiy_S1, fiy_S2, fiy_S3);