2 * This file is part of the GROMACS molecular simulation package.
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.
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.
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.
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.
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.
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.
36 * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
44 #include "../nb_kernel.h"
45 #include "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
49 #include "gromacs/simd/math_x86_avx_128_fma_single.h"
50 #include "kernelutil_x86_avx_128_fma_single.h"
53 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_single
54 * Electrostatics interaction: ReactionField
55 * VdW interaction: LennardJones
56 * Geometry: Water3-Particle
57 * Calculate force/pot: PotentialAndForce
60 nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_single
61 (t_nblist * gmx_restrict nlist,
62 rvec * gmx_restrict xx,
63 rvec * gmx_restrict ff,
64 t_forcerec * gmx_restrict fr,
65 t_mdatoms * gmx_restrict mdatoms,
66 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
67 t_nrnb * gmx_restrict nrnb)
69 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
70 * just 0 for non-waters.
71 * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
72 * jnr indices corresponding to data put in the four positions in the SIMD register.
74 int i_shift_offset,i_coord_offset,outeriter,inneriter;
75 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
76 int jnrA,jnrB,jnrC,jnrD;
77 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
78 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
79 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
81 real *shiftvec,*fshift,*x,*f;
82 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
84 __m128 fscal,rcutoff,rcutoff2,jidxall;
86 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
88 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
90 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
91 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
92 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
93 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
94 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
95 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
96 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
99 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
102 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
103 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
104 __m128 dummy_mask,cutoff_mask;
105 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
106 __m128 one = _mm_set1_ps(1.0);
107 __m128 two = _mm_set1_ps(2.0);
113 jindex = nlist->jindex;
115 shiftidx = nlist->shift;
117 shiftvec = fr->shift_vec[0];
118 fshift = fr->fshift[0];
119 facel = _mm_set1_ps(fr->epsfac);
120 charge = mdatoms->chargeA;
121 krf = _mm_set1_ps(fr->ic->k_rf);
122 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
123 crf = _mm_set1_ps(fr->ic->c_rf);
124 nvdwtype = fr->ntype;
126 vdwtype = mdatoms->typeA;
128 /* Setup water-specific parameters */
129 inr = nlist->iinr[0];
130 iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0]));
131 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
132 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
133 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
135 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
136 rcutoff_scalar = fr->rcoulomb;
137 rcutoff = _mm_set1_ps(rcutoff_scalar);
138 rcutoff2 = _mm_mul_ps(rcutoff,rcutoff);
140 sh_vdw_invrcut6 = _mm_set1_ps(fr->ic->sh_invrc6);
141 rvdw = _mm_set1_ps(fr->rvdw);
143 /* Avoid stupid compiler warnings */
144 jnrA = jnrB = jnrC = jnrD = 0;
153 for(iidx=0;iidx<4*DIM;iidx++)
158 /* Start outer loop over neighborlists */
159 for(iidx=0; iidx<nri; iidx++)
161 /* Load shift vector for this list */
162 i_shift_offset = DIM*shiftidx[iidx];
164 /* Load limits for loop over neighbors */
165 j_index_start = jindex[iidx];
166 j_index_end = jindex[iidx+1];
168 /* Get outer coordinate index */
170 i_coord_offset = DIM*inr;
172 /* Load i particle coords and add shift vector */
173 gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
174 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
176 fix0 = _mm_setzero_ps();
177 fiy0 = _mm_setzero_ps();
178 fiz0 = _mm_setzero_ps();
179 fix1 = _mm_setzero_ps();
180 fiy1 = _mm_setzero_ps();
181 fiz1 = _mm_setzero_ps();
182 fix2 = _mm_setzero_ps();
183 fiy2 = _mm_setzero_ps();
184 fiz2 = _mm_setzero_ps();
186 /* Reset potential sums */
187 velecsum = _mm_setzero_ps();
188 vvdwsum = _mm_setzero_ps();
190 /* Start inner kernel loop */
191 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
194 /* Get j neighbor index, and coordinate index */
199 j_coord_offsetA = DIM*jnrA;
200 j_coord_offsetB = DIM*jnrB;
201 j_coord_offsetC = DIM*jnrC;
202 j_coord_offsetD = DIM*jnrD;
204 /* load j atom coordinates */
205 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
206 x+j_coord_offsetC,x+j_coord_offsetD,
209 /* Calculate displacement vector */
210 dx00 = _mm_sub_ps(ix0,jx0);
211 dy00 = _mm_sub_ps(iy0,jy0);
212 dz00 = _mm_sub_ps(iz0,jz0);
213 dx10 = _mm_sub_ps(ix1,jx0);
214 dy10 = _mm_sub_ps(iy1,jy0);
215 dz10 = _mm_sub_ps(iz1,jz0);
216 dx20 = _mm_sub_ps(ix2,jx0);
217 dy20 = _mm_sub_ps(iy2,jy0);
218 dz20 = _mm_sub_ps(iz2,jz0);
220 /* Calculate squared distance and things based on it */
221 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
222 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
223 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
225 rinv00 = gmx_mm_invsqrt_ps(rsq00);
226 rinv10 = gmx_mm_invsqrt_ps(rsq10);
227 rinv20 = gmx_mm_invsqrt_ps(rsq20);
229 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
230 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
231 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
233 /* Load parameters for j particles */
234 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
235 charge+jnrC+0,charge+jnrD+0);
236 vdwjidx0A = 2*vdwtype[jnrA+0];
237 vdwjidx0B = 2*vdwtype[jnrB+0];
238 vdwjidx0C = 2*vdwtype[jnrC+0];
239 vdwjidx0D = 2*vdwtype[jnrD+0];
241 fjx0 = _mm_setzero_ps();
242 fjy0 = _mm_setzero_ps();
243 fjz0 = _mm_setzero_ps();
245 /**************************
246 * CALCULATE INTERACTIONS *
247 **************************/
249 if (gmx_mm_any_lt(rsq00,rcutoff2))
252 /* Compute parameters for interactions between i and j atoms */
253 qq00 = _mm_mul_ps(iq0,jq0);
254 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
255 vdwparam+vdwioffset0+vdwjidx0B,
256 vdwparam+vdwioffset0+vdwjidx0C,
257 vdwparam+vdwioffset0+vdwjidx0D,
260 /* REACTION-FIELD ELECTROSTATICS */
261 velec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_macc_ps(krf,rsq00,rinv00),crf));
262 felec = _mm_mul_ps(qq00,_mm_msub_ps(rinv00,rinvsq00,krf2));
264 /* LENNARD-JONES DISPERSION/REPULSION */
266 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
267 vvdw6 = _mm_mul_ps(c6_00,rinvsix);
268 vvdw12 = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
269 vvdw = _mm_msub_ps(_mm_nmacc_ps(c12_00,_mm_mul_ps(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
270 _mm_mul_ps( _mm_nmacc_ps(c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
271 fvdw = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
273 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
275 /* Update potential sum for this i atom from the interaction with this j atom. */
276 velec = _mm_and_ps(velec,cutoff_mask);
277 velecsum = _mm_add_ps(velecsum,velec);
278 vvdw = _mm_and_ps(vvdw,cutoff_mask);
279 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
281 fscal = _mm_add_ps(felec,fvdw);
283 fscal = _mm_and_ps(fscal,cutoff_mask);
285 /* Update vectorial force */
286 fix0 = _mm_macc_ps(dx00,fscal,fix0);
287 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
288 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
290 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
291 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
292 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
296 /**************************
297 * CALCULATE INTERACTIONS *
298 **************************/
300 if (gmx_mm_any_lt(rsq10,rcutoff2))
303 /* Compute parameters for interactions between i and j atoms */
304 qq10 = _mm_mul_ps(iq1,jq0);
306 /* REACTION-FIELD ELECTROSTATICS */
307 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_macc_ps(krf,rsq10,rinv10),crf));
308 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
310 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
312 /* Update potential sum for this i atom from the interaction with this j atom. */
313 velec = _mm_and_ps(velec,cutoff_mask);
314 velecsum = _mm_add_ps(velecsum,velec);
318 fscal = _mm_and_ps(fscal,cutoff_mask);
320 /* Update vectorial force */
321 fix1 = _mm_macc_ps(dx10,fscal,fix1);
322 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
323 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
325 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
326 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
327 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
331 /**************************
332 * CALCULATE INTERACTIONS *
333 **************************/
335 if (gmx_mm_any_lt(rsq20,rcutoff2))
338 /* Compute parameters for interactions between i and j atoms */
339 qq20 = _mm_mul_ps(iq2,jq0);
341 /* REACTION-FIELD ELECTROSTATICS */
342 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_macc_ps(krf,rsq20,rinv20),crf));
343 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
345 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
347 /* Update potential sum for this i atom from the interaction with this j atom. */
348 velec = _mm_and_ps(velec,cutoff_mask);
349 velecsum = _mm_add_ps(velecsum,velec);
353 fscal = _mm_and_ps(fscal,cutoff_mask);
355 /* Update vectorial force */
356 fix2 = _mm_macc_ps(dx20,fscal,fix2);
357 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
358 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
360 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
361 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
362 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
366 fjptrA = f+j_coord_offsetA;
367 fjptrB = f+j_coord_offsetB;
368 fjptrC = f+j_coord_offsetC;
369 fjptrD = f+j_coord_offsetD;
371 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
373 /* Inner loop uses 135 flops */
379 /* Get j neighbor index, and coordinate index */
380 jnrlistA = jjnr[jidx];
381 jnrlistB = jjnr[jidx+1];
382 jnrlistC = jjnr[jidx+2];
383 jnrlistD = jjnr[jidx+3];
384 /* Sign of each element will be negative for non-real atoms.
385 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
386 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
388 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
389 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
390 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
391 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
392 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
393 j_coord_offsetA = DIM*jnrA;
394 j_coord_offsetB = DIM*jnrB;
395 j_coord_offsetC = DIM*jnrC;
396 j_coord_offsetD = DIM*jnrD;
398 /* load j atom coordinates */
399 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
400 x+j_coord_offsetC,x+j_coord_offsetD,
403 /* Calculate displacement vector */
404 dx00 = _mm_sub_ps(ix0,jx0);
405 dy00 = _mm_sub_ps(iy0,jy0);
406 dz00 = _mm_sub_ps(iz0,jz0);
407 dx10 = _mm_sub_ps(ix1,jx0);
408 dy10 = _mm_sub_ps(iy1,jy0);
409 dz10 = _mm_sub_ps(iz1,jz0);
410 dx20 = _mm_sub_ps(ix2,jx0);
411 dy20 = _mm_sub_ps(iy2,jy0);
412 dz20 = _mm_sub_ps(iz2,jz0);
414 /* Calculate squared distance and things based on it */
415 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
416 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
417 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
419 rinv00 = gmx_mm_invsqrt_ps(rsq00);
420 rinv10 = gmx_mm_invsqrt_ps(rsq10);
421 rinv20 = gmx_mm_invsqrt_ps(rsq20);
423 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
424 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
425 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
427 /* Load parameters for j particles */
428 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
429 charge+jnrC+0,charge+jnrD+0);
430 vdwjidx0A = 2*vdwtype[jnrA+0];
431 vdwjidx0B = 2*vdwtype[jnrB+0];
432 vdwjidx0C = 2*vdwtype[jnrC+0];
433 vdwjidx0D = 2*vdwtype[jnrD+0];
435 fjx0 = _mm_setzero_ps();
436 fjy0 = _mm_setzero_ps();
437 fjz0 = _mm_setzero_ps();
439 /**************************
440 * CALCULATE INTERACTIONS *
441 **************************/
443 if (gmx_mm_any_lt(rsq00,rcutoff2))
446 /* Compute parameters for interactions between i and j atoms */
447 qq00 = _mm_mul_ps(iq0,jq0);
448 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
449 vdwparam+vdwioffset0+vdwjidx0B,
450 vdwparam+vdwioffset0+vdwjidx0C,
451 vdwparam+vdwioffset0+vdwjidx0D,
454 /* REACTION-FIELD ELECTROSTATICS */
455 velec = _mm_mul_ps(qq00,_mm_sub_ps(_mm_macc_ps(krf,rsq00,rinv00),crf));
456 felec = _mm_mul_ps(qq00,_mm_msub_ps(rinv00,rinvsq00,krf2));
458 /* LENNARD-JONES DISPERSION/REPULSION */
460 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
461 vvdw6 = _mm_mul_ps(c6_00,rinvsix);
462 vvdw12 = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
463 vvdw = _mm_msub_ps(_mm_nmacc_ps(c12_00,_mm_mul_ps(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
464 _mm_mul_ps( _mm_nmacc_ps(c6_00,sh_vdw_invrcut6,vvdw6),one_sixth));
465 fvdw = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
467 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
469 /* Update potential sum for this i atom from the interaction with this j atom. */
470 velec = _mm_and_ps(velec,cutoff_mask);
471 velec = _mm_andnot_ps(dummy_mask,velec);
472 velecsum = _mm_add_ps(velecsum,velec);
473 vvdw = _mm_and_ps(vvdw,cutoff_mask);
474 vvdw = _mm_andnot_ps(dummy_mask,vvdw);
475 vvdwsum = _mm_add_ps(vvdwsum,vvdw);
477 fscal = _mm_add_ps(felec,fvdw);
479 fscal = _mm_and_ps(fscal,cutoff_mask);
481 fscal = _mm_andnot_ps(dummy_mask,fscal);
483 /* Update vectorial force */
484 fix0 = _mm_macc_ps(dx00,fscal,fix0);
485 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
486 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
488 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
489 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
490 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
494 /**************************
495 * CALCULATE INTERACTIONS *
496 **************************/
498 if (gmx_mm_any_lt(rsq10,rcutoff2))
501 /* Compute parameters for interactions between i and j atoms */
502 qq10 = _mm_mul_ps(iq1,jq0);
504 /* REACTION-FIELD ELECTROSTATICS */
505 velec = _mm_mul_ps(qq10,_mm_sub_ps(_mm_macc_ps(krf,rsq10,rinv10),crf));
506 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
508 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
510 /* Update potential sum for this i atom from the interaction with this j atom. */
511 velec = _mm_and_ps(velec,cutoff_mask);
512 velec = _mm_andnot_ps(dummy_mask,velec);
513 velecsum = _mm_add_ps(velecsum,velec);
517 fscal = _mm_and_ps(fscal,cutoff_mask);
519 fscal = _mm_andnot_ps(dummy_mask,fscal);
521 /* Update vectorial force */
522 fix1 = _mm_macc_ps(dx10,fscal,fix1);
523 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
524 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
526 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
527 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
528 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
532 /**************************
533 * CALCULATE INTERACTIONS *
534 **************************/
536 if (gmx_mm_any_lt(rsq20,rcutoff2))
539 /* Compute parameters for interactions between i and j atoms */
540 qq20 = _mm_mul_ps(iq2,jq0);
542 /* REACTION-FIELD ELECTROSTATICS */
543 velec = _mm_mul_ps(qq20,_mm_sub_ps(_mm_macc_ps(krf,rsq20,rinv20),crf));
544 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
546 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
548 /* Update potential sum for this i atom from the interaction with this j atom. */
549 velec = _mm_and_ps(velec,cutoff_mask);
550 velec = _mm_andnot_ps(dummy_mask,velec);
551 velecsum = _mm_add_ps(velecsum,velec);
555 fscal = _mm_and_ps(fscal,cutoff_mask);
557 fscal = _mm_andnot_ps(dummy_mask,fscal);
559 /* Update vectorial force */
560 fix2 = _mm_macc_ps(dx20,fscal,fix2);
561 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
562 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
564 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
565 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
566 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
570 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
571 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
572 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
573 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
575 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
577 /* Inner loop uses 135 flops */
580 /* End of innermost loop */
582 gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
583 f+i_coord_offset,fshift+i_shift_offset);
586 /* Update potential energies */
587 gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
588 gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
590 /* Increment number of inner iterations */
591 inneriter += j_index_end - j_index_start;
593 /* Outer loop uses 20 flops */
596 /* Increment number of outer iterations */
599 /* Update outer/inner flops */
601 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*20 + inneriter*135);
604 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_avx_128_fma_single
605 * Electrostatics interaction: ReactionField
606 * VdW interaction: LennardJones
607 * Geometry: Water3-Particle
608 * Calculate force/pot: Force
611 nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_F_avx_128_fma_single
612 (t_nblist * gmx_restrict nlist,
613 rvec * gmx_restrict xx,
614 rvec * gmx_restrict ff,
615 t_forcerec * gmx_restrict fr,
616 t_mdatoms * gmx_restrict mdatoms,
617 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
618 t_nrnb * gmx_restrict nrnb)
620 /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
621 * just 0 for non-waters.
622 * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
623 * jnr indices corresponding to data put in the four positions in the SIMD register.
625 int i_shift_offset,i_coord_offset,outeriter,inneriter;
626 int j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
627 int jnrA,jnrB,jnrC,jnrD;
628 int jnrlistA,jnrlistB,jnrlistC,jnrlistD;
629 int j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
630 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
632 real *shiftvec,*fshift,*x,*f;
633 real *fjptrA,*fjptrB,*fjptrC,*fjptrD;
635 __m128 fscal,rcutoff,rcutoff2,jidxall;
637 __m128 ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
639 __m128 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
641 __m128 ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
642 int vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
643 __m128 jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
644 __m128 dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
645 __m128 dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10;
646 __m128 dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20;
647 __m128 velec,felec,velecsum,facel,crf,krf,krf2;
650 __m128 rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
653 __m128 one_sixth = _mm_set1_ps(1.0/6.0);
654 __m128 one_twelfth = _mm_set1_ps(1.0/12.0);
655 __m128 dummy_mask,cutoff_mask;
656 __m128 signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
657 __m128 one = _mm_set1_ps(1.0);
658 __m128 two = _mm_set1_ps(2.0);
664 jindex = nlist->jindex;
666 shiftidx = nlist->shift;
668 shiftvec = fr->shift_vec[0];
669 fshift = fr->fshift[0];
670 facel = _mm_set1_ps(fr->epsfac);
671 charge = mdatoms->chargeA;
672 krf = _mm_set1_ps(fr->ic->k_rf);
673 krf2 = _mm_set1_ps(fr->ic->k_rf*2.0);
674 crf = _mm_set1_ps(fr->ic->c_rf);
675 nvdwtype = fr->ntype;
677 vdwtype = mdatoms->typeA;
679 /* Setup water-specific parameters */
680 inr = nlist->iinr[0];
681 iq0 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+0]));
682 iq1 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+1]));
683 iq2 = _mm_mul_ps(facel,_mm_set1_ps(charge[inr+2]));
684 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
686 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
687 rcutoff_scalar = fr->rcoulomb;
688 rcutoff = _mm_set1_ps(rcutoff_scalar);
689 rcutoff2 = _mm_mul_ps(rcutoff,rcutoff);
691 sh_vdw_invrcut6 = _mm_set1_ps(fr->ic->sh_invrc6);
692 rvdw = _mm_set1_ps(fr->rvdw);
694 /* Avoid stupid compiler warnings */
695 jnrA = jnrB = jnrC = jnrD = 0;
704 for(iidx=0;iidx<4*DIM;iidx++)
709 /* Start outer loop over neighborlists */
710 for(iidx=0; iidx<nri; iidx++)
712 /* Load shift vector for this list */
713 i_shift_offset = DIM*shiftidx[iidx];
715 /* Load limits for loop over neighbors */
716 j_index_start = jindex[iidx];
717 j_index_end = jindex[iidx+1];
719 /* Get outer coordinate index */
721 i_coord_offset = DIM*inr;
723 /* Load i particle coords and add shift vector */
724 gmx_mm_load_shift_and_3rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,
725 &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
727 fix0 = _mm_setzero_ps();
728 fiy0 = _mm_setzero_ps();
729 fiz0 = _mm_setzero_ps();
730 fix1 = _mm_setzero_ps();
731 fiy1 = _mm_setzero_ps();
732 fiz1 = _mm_setzero_ps();
733 fix2 = _mm_setzero_ps();
734 fiy2 = _mm_setzero_ps();
735 fiz2 = _mm_setzero_ps();
737 /* Start inner kernel loop */
738 for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
741 /* Get j neighbor index, and coordinate index */
746 j_coord_offsetA = DIM*jnrA;
747 j_coord_offsetB = DIM*jnrB;
748 j_coord_offsetC = DIM*jnrC;
749 j_coord_offsetD = DIM*jnrD;
751 /* load j atom coordinates */
752 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
753 x+j_coord_offsetC,x+j_coord_offsetD,
756 /* Calculate displacement vector */
757 dx00 = _mm_sub_ps(ix0,jx0);
758 dy00 = _mm_sub_ps(iy0,jy0);
759 dz00 = _mm_sub_ps(iz0,jz0);
760 dx10 = _mm_sub_ps(ix1,jx0);
761 dy10 = _mm_sub_ps(iy1,jy0);
762 dz10 = _mm_sub_ps(iz1,jz0);
763 dx20 = _mm_sub_ps(ix2,jx0);
764 dy20 = _mm_sub_ps(iy2,jy0);
765 dz20 = _mm_sub_ps(iz2,jz0);
767 /* Calculate squared distance and things based on it */
768 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
769 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
770 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
772 rinv00 = gmx_mm_invsqrt_ps(rsq00);
773 rinv10 = gmx_mm_invsqrt_ps(rsq10);
774 rinv20 = gmx_mm_invsqrt_ps(rsq20);
776 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
777 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
778 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
780 /* Load parameters for j particles */
781 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
782 charge+jnrC+0,charge+jnrD+0);
783 vdwjidx0A = 2*vdwtype[jnrA+0];
784 vdwjidx0B = 2*vdwtype[jnrB+0];
785 vdwjidx0C = 2*vdwtype[jnrC+0];
786 vdwjidx0D = 2*vdwtype[jnrD+0];
788 fjx0 = _mm_setzero_ps();
789 fjy0 = _mm_setzero_ps();
790 fjz0 = _mm_setzero_ps();
792 /**************************
793 * CALCULATE INTERACTIONS *
794 **************************/
796 if (gmx_mm_any_lt(rsq00,rcutoff2))
799 /* Compute parameters for interactions between i and j atoms */
800 qq00 = _mm_mul_ps(iq0,jq0);
801 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
802 vdwparam+vdwioffset0+vdwjidx0B,
803 vdwparam+vdwioffset0+vdwjidx0C,
804 vdwparam+vdwioffset0+vdwjidx0D,
807 /* REACTION-FIELD ELECTROSTATICS */
808 felec = _mm_mul_ps(qq00,_mm_msub_ps(rinv00,rinvsq00,krf2));
810 /* LENNARD-JONES DISPERSION/REPULSION */
812 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
813 fvdw = _mm_mul_ps(_mm_msub_ps(c12_00,rinvsix,c6_00),_mm_mul_ps(rinvsix,rinvsq00));
815 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
817 fscal = _mm_add_ps(felec,fvdw);
819 fscal = _mm_and_ps(fscal,cutoff_mask);
821 /* Update vectorial force */
822 fix0 = _mm_macc_ps(dx00,fscal,fix0);
823 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
824 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
826 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
827 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
828 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
832 /**************************
833 * CALCULATE INTERACTIONS *
834 **************************/
836 if (gmx_mm_any_lt(rsq10,rcutoff2))
839 /* Compute parameters for interactions between i and j atoms */
840 qq10 = _mm_mul_ps(iq1,jq0);
842 /* REACTION-FIELD ELECTROSTATICS */
843 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
845 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
849 fscal = _mm_and_ps(fscal,cutoff_mask);
851 /* Update vectorial force */
852 fix1 = _mm_macc_ps(dx10,fscal,fix1);
853 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
854 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
856 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
857 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
858 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
862 /**************************
863 * CALCULATE INTERACTIONS *
864 **************************/
866 if (gmx_mm_any_lt(rsq20,rcutoff2))
869 /* Compute parameters for interactions between i and j atoms */
870 qq20 = _mm_mul_ps(iq2,jq0);
872 /* REACTION-FIELD ELECTROSTATICS */
873 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
875 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
879 fscal = _mm_and_ps(fscal,cutoff_mask);
881 /* Update vectorial force */
882 fix2 = _mm_macc_ps(dx20,fscal,fix2);
883 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
884 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
886 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
887 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
888 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
892 fjptrA = f+j_coord_offsetA;
893 fjptrB = f+j_coord_offsetB;
894 fjptrC = f+j_coord_offsetC;
895 fjptrD = f+j_coord_offsetD;
897 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
899 /* Inner loop uses 106 flops */
905 /* Get j neighbor index, and coordinate index */
906 jnrlistA = jjnr[jidx];
907 jnrlistB = jjnr[jidx+1];
908 jnrlistC = jjnr[jidx+2];
909 jnrlistD = jjnr[jidx+3];
910 /* Sign of each element will be negative for non-real atoms.
911 * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
912 * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
914 dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
915 jnrA = (jnrlistA>=0) ? jnrlistA : 0;
916 jnrB = (jnrlistB>=0) ? jnrlistB : 0;
917 jnrC = (jnrlistC>=0) ? jnrlistC : 0;
918 jnrD = (jnrlistD>=0) ? jnrlistD : 0;
919 j_coord_offsetA = DIM*jnrA;
920 j_coord_offsetB = DIM*jnrB;
921 j_coord_offsetC = DIM*jnrC;
922 j_coord_offsetD = DIM*jnrD;
924 /* load j atom coordinates */
925 gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
926 x+j_coord_offsetC,x+j_coord_offsetD,
929 /* Calculate displacement vector */
930 dx00 = _mm_sub_ps(ix0,jx0);
931 dy00 = _mm_sub_ps(iy0,jy0);
932 dz00 = _mm_sub_ps(iz0,jz0);
933 dx10 = _mm_sub_ps(ix1,jx0);
934 dy10 = _mm_sub_ps(iy1,jy0);
935 dz10 = _mm_sub_ps(iz1,jz0);
936 dx20 = _mm_sub_ps(ix2,jx0);
937 dy20 = _mm_sub_ps(iy2,jy0);
938 dz20 = _mm_sub_ps(iz2,jz0);
940 /* Calculate squared distance and things based on it */
941 rsq00 = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
942 rsq10 = gmx_mm_calc_rsq_ps(dx10,dy10,dz10);
943 rsq20 = gmx_mm_calc_rsq_ps(dx20,dy20,dz20);
945 rinv00 = gmx_mm_invsqrt_ps(rsq00);
946 rinv10 = gmx_mm_invsqrt_ps(rsq10);
947 rinv20 = gmx_mm_invsqrt_ps(rsq20);
949 rinvsq00 = _mm_mul_ps(rinv00,rinv00);
950 rinvsq10 = _mm_mul_ps(rinv10,rinv10);
951 rinvsq20 = _mm_mul_ps(rinv20,rinv20);
953 /* Load parameters for j particles */
954 jq0 = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
955 charge+jnrC+0,charge+jnrD+0);
956 vdwjidx0A = 2*vdwtype[jnrA+0];
957 vdwjidx0B = 2*vdwtype[jnrB+0];
958 vdwjidx0C = 2*vdwtype[jnrC+0];
959 vdwjidx0D = 2*vdwtype[jnrD+0];
961 fjx0 = _mm_setzero_ps();
962 fjy0 = _mm_setzero_ps();
963 fjz0 = _mm_setzero_ps();
965 /**************************
966 * CALCULATE INTERACTIONS *
967 **************************/
969 if (gmx_mm_any_lt(rsq00,rcutoff2))
972 /* Compute parameters for interactions between i and j atoms */
973 qq00 = _mm_mul_ps(iq0,jq0);
974 gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
975 vdwparam+vdwioffset0+vdwjidx0B,
976 vdwparam+vdwioffset0+vdwjidx0C,
977 vdwparam+vdwioffset0+vdwjidx0D,
980 /* REACTION-FIELD ELECTROSTATICS */
981 felec = _mm_mul_ps(qq00,_mm_msub_ps(rinv00,rinvsq00,krf2));
983 /* LENNARD-JONES DISPERSION/REPULSION */
985 rinvsix = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
986 fvdw = _mm_mul_ps(_mm_msub_ps(c12_00,rinvsix,c6_00),_mm_mul_ps(rinvsix,rinvsq00));
988 cutoff_mask = _mm_cmplt_ps(rsq00,rcutoff2);
990 fscal = _mm_add_ps(felec,fvdw);
992 fscal = _mm_and_ps(fscal,cutoff_mask);
994 fscal = _mm_andnot_ps(dummy_mask,fscal);
996 /* Update vectorial force */
997 fix0 = _mm_macc_ps(dx00,fscal,fix0);
998 fiy0 = _mm_macc_ps(dy00,fscal,fiy0);
999 fiz0 = _mm_macc_ps(dz00,fscal,fiz0);
1001 fjx0 = _mm_macc_ps(dx00,fscal,fjx0);
1002 fjy0 = _mm_macc_ps(dy00,fscal,fjy0);
1003 fjz0 = _mm_macc_ps(dz00,fscal,fjz0);
1007 /**************************
1008 * CALCULATE INTERACTIONS *
1009 **************************/
1011 if (gmx_mm_any_lt(rsq10,rcutoff2))
1014 /* Compute parameters for interactions between i and j atoms */
1015 qq10 = _mm_mul_ps(iq1,jq0);
1017 /* REACTION-FIELD ELECTROSTATICS */
1018 felec = _mm_mul_ps(qq10,_mm_msub_ps(rinv10,rinvsq10,krf2));
1020 cutoff_mask = _mm_cmplt_ps(rsq10,rcutoff2);
1024 fscal = _mm_and_ps(fscal,cutoff_mask);
1026 fscal = _mm_andnot_ps(dummy_mask,fscal);
1028 /* Update vectorial force */
1029 fix1 = _mm_macc_ps(dx10,fscal,fix1);
1030 fiy1 = _mm_macc_ps(dy10,fscal,fiy1);
1031 fiz1 = _mm_macc_ps(dz10,fscal,fiz1);
1033 fjx0 = _mm_macc_ps(dx10,fscal,fjx0);
1034 fjy0 = _mm_macc_ps(dy10,fscal,fjy0);
1035 fjz0 = _mm_macc_ps(dz10,fscal,fjz0);
1039 /**************************
1040 * CALCULATE INTERACTIONS *
1041 **************************/
1043 if (gmx_mm_any_lt(rsq20,rcutoff2))
1046 /* Compute parameters for interactions between i and j atoms */
1047 qq20 = _mm_mul_ps(iq2,jq0);
1049 /* REACTION-FIELD ELECTROSTATICS */
1050 felec = _mm_mul_ps(qq20,_mm_msub_ps(rinv20,rinvsq20,krf2));
1052 cutoff_mask = _mm_cmplt_ps(rsq20,rcutoff2);
1056 fscal = _mm_and_ps(fscal,cutoff_mask);
1058 fscal = _mm_andnot_ps(dummy_mask,fscal);
1060 /* Update vectorial force */
1061 fix2 = _mm_macc_ps(dx20,fscal,fix2);
1062 fiy2 = _mm_macc_ps(dy20,fscal,fiy2);
1063 fiz2 = _mm_macc_ps(dz20,fscal,fiz2);
1065 fjx0 = _mm_macc_ps(dx20,fscal,fjx0);
1066 fjy0 = _mm_macc_ps(dy20,fscal,fjy0);
1067 fjz0 = _mm_macc_ps(dz20,fscal,fjz0);
1071 fjptrA = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
1072 fjptrB = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
1073 fjptrC = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
1074 fjptrD = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
1076 gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjx0,fjy0,fjz0);
1078 /* Inner loop uses 106 flops */
1081 /* End of innermost loop */
1083 gmx_mm_update_iforce_3atom_swizzle_ps(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1084 f+i_coord_offset,fshift+i_shift_offset);
1086 /* Increment number of inner iterations */
1087 inneriter += j_index_end - j_index_start;
1089 /* Outer loop uses 18 flops */
1092 /* Increment number of outer iterations */
1095 /* Update outer/inner flops */
1097 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*18 + inneriter*106);