Bug Summary

File:gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_c.c
Location:line 319, column 5
Description:Value stored to 'gid' is never read

Annotated Source Code

1/*
2 * This file is part of the GROMACS molecular simulation package.
3 *
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
8 *
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
13 *
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 *
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
31 *
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
34 */
35/*
36 * Note: this file was generated by the GROMACS c kernel generator.
37 */
38#ifdef HAVE_CONFIG_H1
39#include <config.h>
40#endif
41
42#include <math.h>
43
44#include "../nb_kernel.h"
45#include "types/simple.h"
46#include "gromacs/math/vec.h"
47#include "nrnb.h"
48
49/*
50 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_c
51 * Electrostatics interaction: ReactionField
52 * VdW interaction: LennardJones
53 * Geometry: Particle-Particle
54 * Calculate force/pot: PotentialAndForce
55 */
56void
57nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_VF_c
58 (t_nblist * gmx_restrict__restrict nlist,
59 rvec * gmx_restrict__restrict xx,
60 rvec * gmx_restrict__restrict ff,
61 t_forcerec * gmx_restrict__restrict fr,
62 t_mdatoms * gmx_restrict__restrict mdatoms,
63 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict__restrict kernel_data,
64 t_nrnb * gmx_restrict__restrict nrnb)
65{
66 int i_shift_offset,i_coord_offset,j_coord_offset;
67 int j_index_start,j_index_end;
68 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
69 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
70 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
71 real *shiftvec,*fshift,*x,*f;
72 int vdwioffset0;
73 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
74 int vdwjidx0;
75 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
76 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
77 real velec,felec,velecsum,facel,crf,krf,krf2;
78 real *charge;
79 int nvdwtype;
80 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
81 int *vdwtype;
82 real *vdwparam;
83 real rswitch,swV3,swV4,swV5,swF2,swF3,swF4,d,d2,sw,dsw;
84
85 x = xx[0];
86 f = ff[0];
87
88 nri = nlist->nri;
89 iinr = nlist->iinr;
90 jindex = nlist->jindex;
91 jjnr = nlist->jjnr;
92 shiftidx = nlist->shift;
93 gid = nlist->gid;
94 shiftvec = fr->shift_vec[0];
95 fshift = fr->fshift[0];
96 facel = fr->epsfac;
97 charge = mdatoms->chargeA;
98 krf = fr->ic->k_rf;
99 krf2 = krf*2.0;
100 crf = fr->ic->c_rf;
101 nvdwtype = fr->ntype;
102 vdwparam = fr->nbfp;
103 vdwtype = mdatoms->typeA;
104
105 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
106 rcutoff = fr->rcoulomb;
107 rcutoff2 = rcutoff*rcutoff;
108
109 rswitch = fr->rvdw_switch;
110 /* Setup switch parameters */
111 d = rcutoff-rswitch;
112 swV3 = -10.0/(d*d*d);
113 swV4 = 15.0/(d*d*d*d);
114 swV5 = -6.0/(d*d*d*d*d);
115 swF2 = -30.0/(d*d*d);
116 swF3 = 60.0/(d*d*d*d);
117 swF4 = -30.0/(d*d*d*d*d);
118
119 outeriter = 0;
120 inneriter = 0;
121
122 /* Start outer loop over neighborlists */
123 for(iidx=0; iidx<nri; iidx++)
124 {
125 /* Load shift vector for this list */
126 i_shift_offset = DIM3*shiftidx[iidx];
127 shX = shiftvec[i_shift_offset+XX0];
128 shY = shiftvec[i_shift_offset+YY1];
129 shZ = shiftvec[i_shift_offset+ZZ2];
130
131 /* Load limits for loop over neighbors */
132 j_index_start = jindex[iidx];
133 j_index_end = jindex[iidx+1];
134
135 /* Get outer coordinate index */
136 inr = iinr[iidx];
137 i_coord_offset = DIM3*inr;
138
139 /* Load i particle coords and add shift vector */
140 ix0 = shX + x[i_coord_offset+DIM3*0+XX0];
141 iy0 = shY + x[i_coord_offset+DIM3*0+YY1];
142 iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2];
143
144 fix0 = 0.0;
145 fiy0 = 0.0;
146 fiz0 = 0.0;
147
148 /* Load parameters for i particles */
149 iq0 = facel*charge[inr+0];
150 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
151
152 /* Reset potential sums */
153 velecsum = 0.0;
154 vvdwsum = 0.0;
155
156 /* Start inner kernel loop */
157 for(jidx=j_index_start; jidx<j_index_end; jidx++)
158 {
159 /* Get j neighbor index, and coordinate index */
160 jnr = jjnr[jidx];
161 j_coord_offset = DIM3*jnr;
162
163 /* load j atom coordinates */
164 jx0 = x[j_coord_offset+DIM3*0+XX0];
165 jy0 = x[j_coord_offset+DIM3*0+YY1];
166 jz0 = x[j_coord_offset+DIM3*0+ZZ2];
167
168 /* Calculate displacement vector */
169 dx00 = ix0 - jx0;
170 dy00 = iy0 - jy0;
171 dz00 = iz0 - jz0;
172
173 /* Calculate squared distance and things based on it */
174 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
175
176 rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00);
177
178 rinvsq00 = rinv00*rinv00;
179
180 /* Load parameters for j particles */
181 jq0 = charge[jnr+0];
182 vdwjidx0 = 2*vdwtype[jnr+0];
183
184 /**************************
185 * CALCULATE INTERACTIONS *
186 **************************/
187
188 if (rsq00<rcutoff2)
189 {
190
191 r00 = rsq00*rinv00;
192
193 qq00 = iq0*jq0;
194 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
195 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
196
197 /* REACTION-FIELD ELECTROSTATICS */
198 velec = qq00*(rinv00+krf*rsq00-crf);
199 felec = qq00*(rinv00*rinvsq00-krf2);
200
201 /* LENNARD-JONES DISPERSION/REPULSION */
202
203 rinvsix = rinvsq00*rinvsq00*rinvsq00;
204 vvdw6 = c6_00*rinvsix;
205 vvdw12 = c12_00*rinvsix*rinvsix;
206 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
207 fvdw = (vvdw12-vvdw6)*rinvsq00;
208
209 d = r00-rswitch;
210 d = (d>0.0) ? d : 0.0;
211 d2 = d*d;
212 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
213
214 dsw = d2*(swF2+d*(swF3+d*swF4));
215
216 /* Evaluate switch function */
217 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
218 fvdw = fvdw*sw - rinv00*vvdw*dsw;
219 vvdw *= sw;
220
221 /* Update potential sums from outer loop */
222 velecsum += velec;
223 vvdwsum += vvdw;
224
225 fscal = felec+fvdw;
226
227 /* Calculate temporary vectorial force */
228 tx = fscal*dx00;
229 ty = fscal*dy00;
230 tz = fscal*dz00;
231
232 /* Update vectorial force */
233 fix0 += tx;
234 fiy0 += ty;
235 fiz0 += tz;
236 f[j_coord_offset+DIM3*0+XX0] -= tx;
237 f[j_coord_offset+DIM3*0+YY1] -= ty;
238 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
239
240 }
241
242 /* Inner loop uses 63 flops */
243 }
244 /* End of innermost loop */
245
246 tx = ty = tz = 0;
247 f[i_coord_offset+DIM3*0+XX0] += fix0;
248 f[i_coord_offset+DIM3*0+YY1] += fiy0;
249 f[i_coord_offset+DIM3*0+ZZ2] += fiz0;
250 tx += fix0;
251 ty += fiy0;
252 tz += fiz0;
253 fshift[i_shift_offset+XX0] += tx;
254 fshift[i_shift_offset+YY1] += ty;
255 fshift[i_shift_offset+ZZ2] += tz;
256
257 ggid = gid[iidx];
258 /* Update potential energies */
259 kernel_data->energygrp_elec[ggid] += velecsum;
260 kernel_data->energygrp_vdw[ggid] += vvdwsum;
261
262 /* Increment number of inner iterations */
263 inneriter += j_index_end - j_index_start;
264
265 /* Outer loop uses 15 flops */
266 }
267
268 /* Increment number of outer iterations */
269 outeriter += nri;
270
271 /* Update outer/inner flops */
272
273 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*15 + inneriter*63)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_VF] += outeriter*15 + inneriter
*63
;
274}
275/*
276 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_c
277 * Electrostatics interaction: ReactionField
278 * VdW interaction: LennardJones
279 * Geometry: Particle-Particle
280 * Calculate force/pot: Force
281 */
282void
283nb_kernel_ElecRFCut_VdwLJSw_GeomP1P1_F_c
284 (t_nblist * gmx_restrict__restrict nlist,
285 rvec * gmx_restrict__restrict xx,
286 rvec * gmx_restrict__restrict ff,
287 t_forcerec * gmx_restrict__restrict fr,
288 t_mdatoms * gmx_restrict__restrict mdatoms,
289 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict__restrict kernel_data,
290 t_nrnb * gmx_restrict__restrict nrnb)
291{
292 int i_shift_offset,i_coord_offset,j_coord_offset;
293 int j_index_start,j_index_end;
294 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
295 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
296 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
297 real *shiftvec,*fshift,*x,*f;
298 int vdwioffset0;
299 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
300 int vdwjidx0;
301 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
302 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
303 real velec,felec,velecsum,facel,crf,krf,krf2;
304 real *charge;
305 int nvdwtype;
306 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
307 int *vdwtype;
308 real *vdwparam;
309 real rswitch,swV3,swV4,swV5,swF2,swF3,swF4,d,d2,sw,dsw;
310
311 x = xx[0];
312 f = ff[0];
313
314 nri = nlist->nri;
315 iinr = nlist->iinr;
316 jindex = nlist->jindex;
317 jjnr = nlist->jjnr;
318 shiftidx = nlist->shift;
319 gid = nlist->gid;
Value stored to 'gid' is never read
320 shiftvec = fr->shift_vec[0];
321 fshift = fr->fshift[0];
322 facel = fr->epsfac;
323 charge = mdatoms->chargeA;
324 krf = fr->ic->k_rf;
325 krf2 = krf*2.0;
326 crf = fr->ic->c_rf;
327 nvdwtype = fr->ntype;
328 vdwparam = fr->nbfp;
329 vdwtype = mdatoms->typeA;
330
331 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
332 rcutoff = fr->rcoulomb;
333 rcutoff2 = rcutoff*rcutoff;
334
335 rswitch = fr->rvdw_switch;
336 /* Setup switch parameters */
337 d = rcutoff-rswitch;
338 swV3 = -10.0/(d*d*d);
339 swV4 = 15.0/(d*d*d*d);
340 swV5 = -6.0/(d*d*d*d*d);
341 swF2 = -30.0/(d*d*d);
342 swF3 = 60.0/(d*d*d*d);
343 swF4 = -30.0/(d*d*d*d*d);
344
345 outeriter = 0;
346 inneriter = 0;
347
348 /* Start outer loop over neighborlists */
349 for(iidx=0; iidx<nri; iidx++)
350 {
351 /* Load shift vector for this list */
352 i_shift_offset = DIM3*shiftidx[iidx];
353 shX = shiftvec[i_shift_offset+XX0];
354 shY = shiftvec[i_shift_offset+YY1];
355 shZ = shiftvec[i_shift_offset+ZZ2];
356
357 /* Load limits for loop over neighbors */
358 j_index_start = jindex[iidx];
359 j_index_end = jindex[iidx+1];
360
361 /* Get outer coordinate index */
362 inr = iinr[iidx];
363 i_coord_offset = DIM3*inr;
364
365 /* Load i particle coords and add shift vector */
366 ix0 = shX + x[i_coord_offset+DIM3*0+XX0];
367 iy0 = shY + x[i_coord_offset+DIM3*0+YY1];
368 iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2];
369
370 fix0 = 0.0;
371 fiy0 = 0.0;
372 fiz0 = 0.0;
373
374 /* Load parameters for i particles */
375 iq0 = facel*charge[inr+0];
376 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
377
378 /* Start inner kernel loop */
379 for(jidx=j_index_start; jidx<j_index_end; jidx++)
380 {
381 /* Get j neighbor index, and coordinate index */
382 jnr = jjnr[jidx];
383 j_coord_offset = DIM3*jnr;
384
385 /* load j atom coordinates */
386 jx0 = x[j_coord_offset+DIM3*0+XX0];
387 jy0 = x[j_coord_offset+DIM3*0+YY1];
388 jz0 = x[j_coord_offset+DIM3*0+ZZ2];
389
390 /* Calculate displacement vector */
391 dx00 = ix0 - jx0;
392 dy00 = iy0 - jy0;
393 dz00 = iz0 - jz0;
394
395 /* Calculate squared distance and things based on it */
396 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
397
398 rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00);
399
400 rinvsq00 = rinv00*rinv00;
401
402 /* Load parameters for j particles */
403 jq0 = charge[jnr+0];
404 vdwjidx0 = 2*vdwtype[jnr+0];
405
406 /**************************
407 * CALCULATE INTERACTIONS *
408 **************************/
409
410 if (rsq00<rcutoff2)
411 {
412
413 r00 = rsq00*rinv00;
414
415 qq00 = iq0*jq0;
416 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
417 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
418
419 /* REACTION-FIELD ELECTROSTATICS */
420 felec = qq00*(rinv00*rinvsq00-krf2);
421
422 /* LENNARD-JONES DISPERSION/REPULSION */
423
424 rinvsix = rinvsq00*rinvsq00*rinvsq00;
425 vvdw6 = c6_00*rinvsix;
426 vvdw12 = c12_00*rinvsix*rinvsix;
427 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
428 fvdw = (vvdw12-vvdw6)*rinvsq00;
429
430 d = r00-rswitch;
431 d = (d>0.0) ? d : 0.0;
432 d2 = d*d;
433 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
434
435 dsw = d2*(swF2+d*(swF3+d*swF4));
436
437 /* Evaluate switch function */
438 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
439 fvdw = fvdw*sw - rinv00*vvdw*dsw;
440
441 fscal = felec+fvdw;
442
443 /* Calculate temporary vectorial force */
444 tx = fscal*dx00;
445 ty = fscal*dy00;
446 tz = fscal*dz00;
447
448 /* Update vectorial force */
449 fix0 += tx;
450 fiy0 += ty;
451 fiz0 += tz;
452 f[j_coord_offset+DIM3*0+XX0] -= tx;
453 f[j_coord_offset+DIM3*0+YY1] -= ty;
454 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
455
456 }
457
458 /* Inner loop uses 56 flops */
459 }
460 /* End of innermost loop */
461
462 tx = ty = tz = 0;
463 f[i_coord_offset+DIM3*0+XX0] += fix0;
464 f[i_coord_offset+DIM3*0+YY1] += fiy0;
465 f[i_coord_offset+DIM3*0+ZZ2] += fiz0;
466 tx += fix0;
467 ty += fiy0;
468 tz += fiz0;
469 fshift[i_shift_offset+XX0] += tx;
470 fshift[i_shift_offset+YY1] += ty;
471 fshift[i_shift_offset+ZZ2] += tz;
472
473 /* Increment number of inner iterations */
474 inneriter += j_index_end - j_index_start;
475
476 /* Outer loop uses 13 flops */
477 }
478
479 /* Increment number of outer iterations */
480 outeriter += nri;
481
482 /* Update outer/inner flops */
483
484 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*13 + inneriter*56)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_F] += outeriter*13 + inneriter
*56
;
485}