K-computer specific modifications
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_sparc64_hpc_ace_double / nb_kernel_template_sparc64_hpc_ace_double.pre
1 /* #if 0 */
2 /*
3  * This file is part of the GROMACS molecular simulation package.
4  *
5  * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
6  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
7  * and including many others, as listed in the AUTHORS file in the
8  * top-level source directory and at http://www.gromacs.org.
9  *
10  * GROMACS is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public License
12  * as published by the Free Software Foundation; either version 2.1
13  * of the License, or (at your option) any later version.
14  *
15  * GROMACS is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with GROMACS; if not, see
22  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
24  *
25  * If you want to redistribute modifications to GROMACS, please
26  * consider that scientific software is very special. Version
27  * control is crucial - bugs must be traceable. We will be happy to
28  * consider code for inclusion in the official distribution, but
29  * derived work must not be called official GROMACS. Details are found
30  * in the README & COPYING files - if they are missing, get the
31  * official version at http://www.gromacs.org.
32  *
33  * To help us fund GROMACS development, we humbly ask that you cite
34  * the research papers on the package. Check out http://www.gromacs.org.
35  */
36 #error This file must be processed with the Gromacs pre-preprocessor
37 /* #endif */
38 /* #if INCLUDE_HEADER */
39 #ifdef HAVE_CONFIG_H
40 #include <config.h>
41 #endif
42
43 #include <math.h>
44
45 #include "../nb_kernel.h"
46 #include "types/simple.h"
47 #include "gromacs/legacyheaders/vec.h"
48 #include "nrnb.h"
49
50 #include "kernelutil_sparc64_hpc_ace_double.h"
51 /* #endif */
52
53 /* ## List of variables set by the generating script:                                    */
54 /* ##                                                                                    */
55 /* ## Setttings that apply to the entire kernel:                                         */
56 /* ## KERNEL_ELEC:           String, choice for electrostatic interactions               */
57 /* ## KERNEL_VDW:            String, choice for van der Waals interactions               */
58 /* ## KERNEL_NAME:           String, name of this kernel                                 */
59 /* ## KERNEL_VF:             String telling if we calculate potential, force, or both    */
60 /* ## GEOMETRY_I/GEOMETRY_J: String, name of each geometry, e.g. 'Water3' or '1Particle' */
61 /* ##                                                                                    */
62 /* ## Setttings that apply to particles in the outer (I) or inner (J) loops:             */
63 /* ## PARTICLES_I[]/         Arrays with lists of i/j particles to use in kernel. It is  */
64 /* ## PARTICLES_J[]:         just [0] for particle geometry, but can be longer for water */
65 /* ## PARTICLES_ELEC_I[]/    Arrays with lists of i/j particle that have electrostatics  */
66 /* ## PARTICLES_ELEC_J[]:    interactions that should be calculated in this kernel.      */
67 /* ## PARTICLES_VDW_I[]/     Arrays with the list of i/j particle that have VdW          */
68 /* ## PARTICLES_VDW_J[]:     interactions that should be calculated in this kernel.      */
69 /* ##                                                                                    */
70 /* ## Setttings for pairs of interactions (e.g. 2nd i particle against 1st j particle)   */
71 /* ## PAIRS_IJ[]:            Array with (i,j) tuples of pairs for which interactions     */
72 /* ##                        should be calculated in this kernel. Zero-charge particles  */
73 /* ##                        do not have interactions with particles without vdw, and    */
74 /* ##                        Vdw-only interactions are not evaluated in a no-vdw-kernel. */
75 /* ## INTERACTION_FLAGS[][]: 2D matrix, dimension e.g. 3*3 for water-water interactions. */
76 /* ##                        For each i-j pair, the element [I][J] is a list of strings  */
77 /* ##                        defining properties/flags of this interaction. Examples     */
78 /* ##                        include 'electrostatics'/'vdw' if that type of interaction  */
79 /* ##                        should be evaluated, 'rsq'/'rinv'/'rinvsq' if those values  */
80 /* ##                        are needed, and 'exactcutoff' or 'shift','switch' to        */
81 /* ##                        decide if the force/potential should be modified. This way  */
82 /* ##                        we only calculate values absolutely needed for each case.   */
83
84 /* ## Calculate the size and offset for (merged/interleaved) table data */
85
86 /*
87  * Gromacs nonbonded kernel:   {KERNEL_NAME}
88  * Electrostatics interaction: {KERNEL_ELEC}
89  * VdW interaction:            {KERNEL_VDW}
90  * Geometry:                   {GEOMETRY_I}-{GEOMETRY_J}
91  * Calculate force/pot:        {KERNEL_VF}
92  */
93 void
94 {KERNEL_NAME}
95                     (t_nblist                    * gmx_restrict       nlist,
96                      rvec                        * gmx_restrict          xx,
97                      rvec                        * gmx_restrict          ff,
98                      t_forcerec                  * gmx_restrict          fr,
99                      t_mdatoms                   * gmx_restrict     mdatoms,
100                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
101                      t_nrnb                      * gmx_restrict        nrnb)
102 {
103     /* ## Not all variables are used for all kernels, but any optimizing compiler fixes that, */
104     /* ## so there is no point in going to extremes to exclude variables that are not needed. */
105     /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
106      * just 0 for non-waters.
107      * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
108      * jnr indices corresponding to data put in the four positions in the SIMD register.
109      */
110     int              i_shift_offset,i_coord_offset,outeriter,inneriter;
111     int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
112     int              jnrA,jnrB;
113     int              j_coord_offsetA,j_coord_offsetB;
114     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
115     real             rcutoff_scalar;
116     real             *shiftvec,*fshift,*x,*f;
117     _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
118     /* #for I in PARTICLES_I */
119     int              vdwioffset{I};
120     _fjsp_v2r8       ix{I},iy{I},iz{I},fix{I},fiy{I},fiz{I},iq{I},isai{I};
121     /* #endfor */
122     /* #for J in PARTICLES_J */
123     int              vdwjidx{J}A,vdwjidx{J}B;
124     _fjsp_v2r8       jx{J},jy{J},jz{J},fjx{J},fjy{J},fjz{J},jq{J},isaj{J};
125     /* #endfor */
126     /* #for I,J in PAIRS_IJ */
127     _fjsp_v2r8       dx{I}{J},dy{I}{J},dz{I}{J},rsq{I}{J},rinv{I}{J},rinvsq{I}{J},r{I}{J},qq{I}{J},c6_{I}{J},c12_{I}{J};
128     /* #endfor */
129     /* #if KERNEL_ELEC != 'None' */
130     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
131     real             *charge;
132     /* #endif */
133     /* #if 'GeneralizedBorn' in KERNEL_ELEC */
134     _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
135     _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
136     real             *invsqrta,*dvda,*gbtab;
137     /* #endif */
138     /* #if KERNEL_VDW != 'None' */
139     int              nvdwtype;
140     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
141     int              *vdwtype;
142     real             *vdwparam;
143     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
144     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
145     /* #endif */
146     /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
147     _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
148     real             *vftab;
149     /* #endif */
150     /* #if 'LJEwald' in KERNEL_VDW */
151     /* #for I,J in PAIRS_IJ */
152     _fjsp_v2r8           c6grid_{I}{J};
153     /* #endfor */
154     real                 *vdwgridparam;
155     _fjsp_v2r8           ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,f6A,f6B,sh_lj_ewald;
156     _fjsp_v2r8           one_half = gmx_fjsp_set1_v2r8(0.5);
157     _fjsp_v2r8           minus_one = gmx_fjsp_set1_v2r8(-1.0);
158     /* #endif */
159     /* #if 'Ewald' in KERNEL_ELEC */
160     _fjsp_v2r8       ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace,ewtabF,ewtabFn,ewtabD,ewtabV;
161     real             *ewtab;
162     /* #endif */
163     /* #if 'PotentialSwitch' in [KERNEL_MOD_ELEC,KERNEL_MOD_VDW] */
164     _fjsp_v2r8       rswitch,swV3,swV4,swV5,swF2,swF3,swF4,d,d2,sw,dsw;
165     real             rswitch_scalar,d_scalar;
166     /* #endif */
167     _fjsp_v2r8       itab_tmp;
168     _fjsp_v2r8       dummy_mask,cutoff_mask;
169     _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
170     _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
171     union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
172
173     x                = xx[0];
174     f                = ff[0];
175
176     nri              = nlist->nri;
177     iinr             = nlist->iinr;
178     jindex           = nlist->jindex;
179     jjnr             = nlist->jjnr;
180     shiftidx         = nlist->shift;
181     gid              = nlist->gid;
182     shiftvec         = fr->shift_vec[0];
183     fshift           = fr->fshift[0];
184     /* #if KERNEL_ELEC != 'None' */
185     facel            = gmx_fjsp_set1_v2r8(fr->epsfac);
186     charge           = mdatoms->chargeA;
187     /*     #if 'ReactionField' in KERNEL_ELEC */
188     krf              = gmx_fjsp_set1_v2r8(fr->ic->k_rf);
189     krf2             = gmx_fjsp_set1_v2r8(fr->ic->k_rf*2.0);
190     crf              = gmx_fjsp_set1_v2r8(fr->ic->c_rf);
191     /*     #endif */
192     /* #endif */
193     /* #if KERNEL_VDW != 'None' */
194     nvdwtype         = fr->ntype;
195     vdwparam         = fr->nbfp;
196     vdwtype          = mdatoms->typeA;
197     /* #endif */
198     /* #if 'LJEwald' in KERNEL_VDW */
199     vdwgridparam     = fr->ljpme_c6grid;
200     sh_lj_ewald      = gmx_fjsp_set1_v2r8(fr->ic->sh_lj_ewald);
201     ewclj            = gmx_fjsp_set1_v2r8(fr->ewaldcoeff_lj);
202     ewclj2           = _fjsp_mul_v2r8(minus_one,_fjsp_mul_v2r8(ewclj,ewclj));
203     /* #endif */
204
205     /* #if 'Table' in KERNEL_ELEC and 'Table' in KERNEL_VDW */
206     vftab            = kernel_data->table_elec_vdw->data;
207     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_elec_vdw->scale);
208     /* #elif 'Table' in KERNEL_ELEC */
209     vftab            = kernel_data->table_elec->data;
210     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_elec->scale);
211     /* #elif 'Table' in KERNEL_VDW */
212     vftab            = kernel_data->table_vdw->data;
213     vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
214     /* #endif */
215
216     /* #if 'Ewald' in KERNEL_ELEC */
217     sh_ewald         = gmx_fjsp_set1_v2r8(fr->ic->sh_ewald);
218     /*     #if KERNEL_VF=='Force' and KERNEL_MOD_ELEC!='PotentialSwitch' */
219     ewtab            = fr->ic->tabq_coul_F;
220     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
221     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
222     /*     #else */
223     ewtab            = fr->ic->tabq_coul_FDV0;
224     ewtabscale       = gmx_fjsp_set1_v2r8(fr->ic->tabq_scale);
225     ewtabhalfspace   = gmx_fjsp_set1_v2r8(0.5/fr->ic->tabq_scale);
226      /*     #endif */
227     /* #endif */
228
229     /* #if KERNEL_ELEC=='GeneralizedBorn' */
230     invsqrta         = fr->invsqrta;
231     dvda             = fr->dvda;
232     gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab.scale);
233     gbtab            = fr->gbtab.data;
234     gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
235     /* #endif */
236
237     /* #if 'Water' in GEOMETRY_I */
238     /* Setup water-specific parameters */
239     inr              = nlist->iinr[0];
240     /*     #for I in PARTICLES_ELEC_I */
241     iq{I}              = _fjsp_mul_v2r8(facel,gmx_fjsp_set1_v2r8(charge[inr+{I}]));
242     /*     #endfor */
243     /*     #for I in PARTICLES_VDW_I */
244     vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
245     /*     #endfor */
246     /* #endif */
247
248     /* #if 'Water' in GEOMETRY_J */
249     /*     #for J in PARTICLES_ELEC_J */
250     jq{J}              = gmx_fjsp_set1_v2r8(charge[inr+{J}]);
251     /*     #endfor */
252     /*     #for J in PARTICLES_VDW_J */
253     vdwjidx{J}A        = 2*vdwtype[inr+{J}];
254     /*     #endfor */
255     /*     #for I,J in PAIRS_IJ */
256     /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
257     qq{I}{J}             = _fjsp_mul_v2r8(iq{I},jq{J});
258     /*         #endif */
259     /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
260     /*             #if 'LJEwald' in KERNEL_VDW */
261     c6_{I}{J}            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A]);
262     c12_{I}{J}           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A+1]);
263     c6grid_{I}{J}        = gmx_fjsp_set1_v2r8(vdwgridparam[vdwioffset{I}+vdwjidx{J}A]);
264     /*             #else */
265     c6_{I}{J}            = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A]);
266     c12_{I}{J}           = gmx_fjsp_set1_v2r8(vdwparam[vdwioffset{I}+vdwjidx{J}A+1]);
267     /*             #endif */
268     /*         #endif */
269     /*     #endfor */
270     /* #endif */
271
272     /* #if KERNEL_MOD_ELEC!='None' or KERNEL_MOD_VDW!='None' */
273     /*     #if KERNEL_ELEC!='None' */
274     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
275     rcutoff_scalar   = fr->rcoulomb;
276     /*     #else */
277     rcutoff_scalar   = fr->rvdw;
278     /*     #endif */
279     rcutoff          = gmx_fjsp_set1_v2r8(rcutoff_scalar);
280     rcutoff2         = _fjsp_mul_v2r8(rcutoff,rcutoff);
281     /* #endif */
282
283     /* #if KERNEL_MOD_VDW=='PotentialShift' */
284     sh_vdw_invrcut6  = gmx_fjsp_set1_v2r8(fr->ic->sh_invrc6);
285     rvdw             = gmx_fjsp_set1_v2r8(fr->rvdw);
286     /* #endif */
287
288     /* #if 'PotentialSwitch' in [KERNEL_MOD_ELEC,KERNEL_MOD_VDW] */
289     /*     #if KERNEL_MOD_ELEC=='PotentialSwitch'  */
290     rswitch_scalar   = fr->rcoulomb_switch;
291     rswitch          = gmx_fjsp_set1_v2r8(rswitch_scalar);
292     /*     #else */
293     rswitch_scalar   = fr->rvdw_switch;
294     rswitch          = gmx_fjsp_set1_v2r8(rswitch_scalar);
295     /*     #endif */
296     /* Setup switch parameters */
297     d_scalar         = rcutoff_scalar-rswitch_scalar;
298     d                = gmx_fjsp_set1_v2r8(d_scalar);
299     swV3             = gmx_fjsp_set1_v2r8(-10.0/(d_scalar*d_scalar*d_scalar));
300     swV4             = gmx_fjsp_set1_v2r8( 15.0/(d_scalar*d_scalar*d_scalar*d_scalar));
301     swV5             = gmx_fjsp_set1_v2r8( -6.0/(d_scalar*d_scalar*d_scalar*d_scalar*d_scalar));
302     /*     #if 'Force' in KERNEL_VF */
303     swF2             = gmx_fjsp_set1_v2r8(-30.0/(d_scalar*d_scalar*d_scalar));
304     swF3             = gmx_fjsp_set1_v2r8( 60.0/(d_scalar*d_scalar*d_scalar*d_scalar));
305     swF4             = gmx_fjsp_set1_v2r8(-30.0/(d_scalar*d_scalar*d_scalar*d_scalar*d_scalar));
306     /*     #endif */
307     /* #endif */
308
309     /* Avoid stupid compiler warnings */
310     jnrA = jnrB = 0;
311     j_coord_offsetA = 0;
312     j_coord_offsetB = 0;
313
314     /* ## Keep track of the floating point operations we issue for reporting! */
315     /* #define OUTERFLOPS 0 */
316     outeriter        = 0;
317     inneriter        = 0;
318
319     /* Start outer loop over neighborlists */
320     for(iidx=0; iidx<nri; iidx++)
321     {
322         /* Load shift vector for this list */
323         i_shift_offset   = DIM*shiftidx[iidx];
324
325         /* Load limits for loop over neighbors */
326         j_index_start    = jindex[iidx];
327         j_index_end      = jindex[iidx+1];
328
329         /* Get outer coordinate index */
330         inr              = iinr[iidx];
331         i_coord_offset   = DIM*inr;
332
333         /* Load i particle coords and add shift vector */
334         /* #if GEOMETRY_I == 'Particle' */
335         gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
336         /* #elif GEOMETRY_I == 'Water3' */
337         gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
338                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2);
339         /* #elif GEOMETRY_I == 'Water4' */
340         /*     #if 0 in PARTICLES_I                 */
341         gmx_fjsp_load_shift_and_4rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,
342                                                  &ix0,&iy0,&iz0,&ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
343         /*     #else                                */
344         gmx_fjsp_load_shift_and_3rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset+DIM,
345                                                  &ix1,&iy1,&iz1,&ix2,&iy2,&iz2,&ix3,&iy3,&iz3);
346         /*     #endif                               */
347         /* #endif                                   */
348
349         /* #if 'Force' in KERNEL_VF */
350         /*     #for I in PARTICLES_I */
351         fix{I}             = _fjsp_setzero_v2r8();
352         fiy{I}             = _fjsp_setzero_v2r8();
353         fiz{I}             = _fjsp_setzero_v2r8();
354         /*     #endfor */
355         /* #endif */
356
357         /* ## For water we already preloaded parameters at the start of the kernel */
358         /* #if not 'Water' in GEOMETRY_I */
359         /* Load parameters for i particles */
360         /*     #for I in PARTICLES_ELEC_I */
361         iq{I}              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+{I}));
362         /*         #define OUTERFLOPS OUTERFLOPS+1 */
363         /*         #if KERNEL_ELEC=='GeneralizedBorn' */
364         isai{I}            = gmx_fjsp_load1_v2r8(invsqrta+inr+{I});
365         /*         #endif */
366         /*     #endfor */
367         /*     #for I in PARTICLES_VDW_I */
368         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
369         /*     #endfor */
370         /* #endif */
371
372         /* #if 'Potential' in KERNEL_VF */
373         /* Reset potential sums */
374         /*     #if KERNEL_ELEC != 'None' */
375         velecsum         = _fjsp_setzero_v2r8();
376         /*     #endif */
377         /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
378         vgbsum           = _fjsp_setzero_v2r8();
379         /*     #endif */
380         /*     #if KERNEL_VDW != 'None' */
381         vvdwsum          = _fjsp_setzero_v2r8();
382         /*     #endif */
383         /* #endif */
384         /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
385         dvdasum          = _fjsp_setzero_v2r8();
386         /*     #endif */
387
388         /* #for ROUND in ['Loop','Epilogue'] */
389
390         /* #if ROUND =='Loop' */
391         /* Start inner kernel loop */
392         for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
393         {
394         /* ## First round is normal loop (next statement resets indentation) */
395         /*     #if 0 */
396         }
397         /*     #endif */
398         /* #else */
399         if(jidx<j_index_end)
400         {
401         /* ## Second round is epilogue */
402         /* #endif */
403         /* #define INNERFLOPS 0 */
404
405             /* #if ROUND =='Loop' */
406             /* Get j neighbor index, and coordinate index */
407             jnrA             = jjnr[jidx];
408             jnrB             = jjnr[jidx+1];
409             j_coord_offsetA  = DIM*jnrA;
410             j_coord_offsetB  = DIM*jnrB;
411
412             /* load j atom coordinates */
413             /*     #if GEOMETRY_J == 'Particle'             */
414             gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
415                                               &jx0,&jy0,&jz0);
416             /*     #elif GEOMETRY_J == 'Water3'             */
417             gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
418                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
419             /*     #elif GEOMETRY_J == 'Water4'             */
420             /*         #if 0 in PARTICLES_J                 */
421             gmx_fjsp_load_4rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
422                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
423                                               &jy2,&jz2,&jx3,&jy3,&jz3);
424             /*         #else                                */
425             gmx_fjsp_load_3rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,x+j_coord_offsetB+DIM,
426                                               &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
427             /*         #endif                               */
428             /*     #endif                                   */
429             /* #else */
430             jnrA             = jjnr[jidx];
431             j_coord_offsetA  = DIM*jnrA;
432
433             /* load j atom coordinates */
434             /*     #if GEOMETRY_J == 'Particle'             */
435             gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
436                                               &jx0,&jy0,&jz0);
437             /*     #elif GEOMETRY_J == 'Water3'             */
438             gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
439                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,&jy2,&jz2);
440             /*     #elif GEOMETRY_J == 'Water4'             */
441             /*         #if 0 in PARTICLES_J                 */
442             gmx_fjsp_load_4rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
443                                               &jx0,&jy0,&jz0,&jx1,&jy1,&jz1,&jx2,
444                                               &jy2,&jz2,&jx3,&jy3,&jz3);
445             /*         #else                                */
446             gmx_fjsp_load_3rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA+DIM,
447                                               &jx1,&jy1,&jz1,&jx2,&jy2,&jz2,&jx3,&jy3,&jz3);
448             /*         #endif                               */
449             /*     #endif                                   */
450             /* #endif */
451
452             /* Calculate displacement vector */
453             /* #for I,J in PAIRS_IJ */
454             dx{I}{J}             = _fjsp_sub_v2r8(ix{I},jx{J});
455             dy{I}{J}             = _fjsp_sub_v2r8(iy{I},jy{J});
456             dz{I}{J}             = _fjsp_sub_v2r8(iz{I},jz{J});
457             /*     #define INNERFLOPS INNERFLOPS+3 */
458             /* #endfor */
459
460             /* Calculate squared distance and things based on it */
461             /* #for I,J in PAIRS_IJ */
462             rsq{I}{J}            = gmx_fjsp_calc_rsq_v2r8(dx{I}{J},dy{I}{J},dz{I}{J});
463             /*     #define INNERFLOPS INNERFLOPS+5 */
464             /* #endfor */
465
466             /* #for I,J in PAIRS_IJ */
467             /*     #if 'rinv' in INTERACTION_FLAGS[I][J] */
468             rinv{I}{J}           = gmx_fjsp_invsqrt_v2r8(rsq{I}{J});
469             /*         #define INNERFLOPS INNERFLOPS+5 */
470             /*     #endif */
471             /* #endfor */
472
473             /* #for I,J in PAIRS_IJ */
474             /*     #if 'rinvsq' in INTERACTION_FLAGS[I][J] */
475             /*         # if 'rinv' not in INTERACTION_FLAGS[I][J] */
476             rinvsq{I}{J}         = gmx_fjsp_inv_v2r8(rsq{I}{J});
477             /*             #define INNERFLOPS INNERFLOPS+4 */
478             /*         #else */
479             rinvsq{I}{J}         = _fjsp_mul_v2r8(rinv{I}{J},rinv{I}{J});
480             /*             #define INNERFLOPS INNERFLOPS+1 */
481             /*         #endif */
482             /*     #endif */
483             /* #endfor */
484
485             /* #if not 'Water' in GEOMETRY_J */
486             /* Load parameters for j particles */
487             /*     #for J in PARTICLES_ELEC_J */
488             /*         #if ROUND =='Loop' */
489             jq{J}              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+{J},charge+jnrB+{J});
490             /*         #else */
491             jq{J}              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+{J});
492             /*         #endif */
493             /*         #if KERNEL_ELEC=='GeneralizedBorn' */
494             /*             #if ROUND =='Loop' */
495             isaj{J}            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+{J},invsqrta+jnrB+{J});
496             /*             #else */
497             isaj{J}            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+{J});
498             /*             #endif */
499             /*         #endif */
500             /*     #endfor */
501             /*     #for J in PARTICLES_VDW_J */
502             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
503             /*         #if ROUND =='Loop' */
504             vdwjidx{J}B        = 2*vdwtype[jnrB+{J}];
505             /*         #endif */
506             /*     #endfor */
507             /* #endif */
508
509             /* #if 'Force' in KERNEL_VF and not 'Particle' in GEOMETRY_I */
510             /*     #for J in PARTICLES_J */
511             fjx{J}             = _fjsp_setzero_v2r8();
512             fjy{J}             = _fjsp_setzero_v2r8();
513             fjz{J}             = _fjsp_setzero_v2r8();
514             /*     #endfor */
515             /* #endif */
516
517             /* #for I,J in PAIRS_IJ */
518
519             /**************************
520              * CALCULATE INTERACTIONS *
521              **************************/
522
523             /*     #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
524             /*         ## We always calculate rinv/rinvsq above to enable pipelineing in compilers (performance tested on x86) */
525             if (gmx_fjsp_any_lt_v2r8(rsq{I}{J},rcutoff2))
526             {
527                 /*     #if 0    ## this and the next two lines is a hack to maintain auto-indentation in template file */
528             }
529             /*         #endif */
530             /*         #define INNERFLOPS INNERFLOPS+1 */
531             /*     #endif */
532
533             /*     #if 'r' in INTERACTION_FLAGS[I][J] */
534             r{I}{J}              = _fjsp_mul_v2r8(rsq{I}{J},rinv{I}{J});
535              /*         #define INNERFLOPS INNERFLOPS+1 */
536             /*     #endif */
537
538             /*     ## For water geometries we already loaded parameters at the start of the kernel */
539             /*     #if not 'Water' in GEOMETRY_J */
540             /* Compute parameters for interactions between i and j atoms */
541             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
542             qq{I}{J}             = _fjsp_mul_v2r8(iq{I},jq{J});
543             /*             #define INNERFLOPS INNERFLOPS+1 */
544             /*         #endif */
545             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
546             gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset{I}+vdwjidx{J}A,
547                                          vdwparam+vdwioffset{I}+vdwjidx{J}B,&c6_{I}{J},&c12_{I}{J});
548
549             /*             #if 'LJEwald' in KERNEL_VDW */
550             c6grid_{I}{J}       = gmx_fjsp_load_2real_swizzle_v2r8(vdwgridparam+vdwioffset{I}+vdwjidx{J}A,
551                                                                    vdwgridparam+vdwioffset{I}+vdwjidx{J}B);
552             /*             #endif */
553             /*         #endif */
554             /*     #endif */
555
556             /*     #if 'table' in INTERACTION_FLAGS[I][J] */
557             /* Calculate table index by multiplying r with table scale and truncate to integer */
558             rt               = _fjsp_mul_v2r8(r{I}{J},vftabscale);
559             itab_tmp         = _fjsp_dtox_v2r8(rt);
560             vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
561             twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
562             _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
563
564             /*         #define INNERFLOPS INNERFLOPS+4                          */
565             /*         #if 'Table' in KERNEL_ELEC and 'Table' in KERNEL_VDW     */
566             /*             ## 3 tables, 4 data per point: multiply index by 12 */
567             vfconv.i[0]     *= 12;
568             vfconv.i[1]     *= 12;
569             /*         #elif 'Table' in KERNEL_ELEC                             */
570             /*             ## 1 table, 4 data per point: multiply index by 4   */
571             vfconv.i[0]     *= 4;
572             vfconv.i[1]     *= 4;
573             /*         #elif 'Table' in KERNEL_VDW                              */
574             /*             ## 2 tables, 4 data per point: multiply index by 8  */
575             vfconv.i[0]     *= 8;
576             vfconv.i[1]     *= 8;
577             /*         #endif                                                   */
578             /*     #endif */
579
580             /*     ## ELECTROSTATIC INTERACTIONS */
581             /*     #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
582
583             /*         #if KERNEL_ELEC=='Coulomb' */
584
585             /* COULOMB ELECTROSTATICS */
586             velec            = _fjsp_mul_v2r8(qq{I}{J},rinv{I}{J});
587             /*             #define INNERFLOPS INNERFLOPS+1 */
588             /*             #if 'Force' in KERNEL_VF */
589             felec            = _fjsp_mul_v2r8(velec,rinvsq{I}{J});
590             /*                 #define INNERFLOPS INNERFLOPS+2 */
591             /*             #endif */
592
593             /*         #elif KERNEL_ELEC=='ReactionField' */
594
595             /* REACTION-FIELD ELECTROSTATICS */
596             /*             #if 'Potential' in KERNEL_VF */
597             velec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_sub_v2r8(_fjsp_madd_v2r8(krf,rsq{I}{J},rinv{I}{J}),crf));
598             /*                 #define INNERFLOPS INNERFLOPS+4 */
599             /*             #endif */
600             /*             #if 'Force' in KERNEL_VF */
601             felec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_msub_v2r8(rinv{I}{J},rinvsq{I}{J},krf2));
602             /*                 #define INNERFLOPS INNERFLOPS+3 */
603             /*             #endif */
604
605             /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
606
607             /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
608             isaprod          = _fjsp_mul_v2r8(isai{I},isaj{J});
609             gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq{I}{J},_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
610             gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
611             /*             #define INNERFLOPS INNERFLOPS+5 */
612
613             /* Calculate generalized born table index - this is a separate table from the normal one,
614              * but we use the same procedure by multiplying r with scale and truncating to integer.
615              */
616             rt               = _fjsp_mul_v2r8(r{I}{J},gbscale);
617             itab_tmp         = _fjsp_dtox_v2r8(rt);
618             gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
619             _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
620
621             Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
622             /*             #if ROUND == 'Loop' */
623             F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
624             /*             #else */
625             F                = _fjsp_setzero_v2r8();
626             /*             #endif */
627             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
628             G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
629             /*             #if ROUND == 'Loop' */
630             H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
631             /*             #else */
632             H                = _fjsp_setzero_v2r8();
633             /*             #endif */
634             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
635             Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
636             VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
637             vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
638             /*             #define INNERFLOPS INNERFLOPS+10 */
639
640             /*             #if 'Force' in KERNEL_VF */
641             twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
642             FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
643             fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
644             dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r{I}{J},vgb));
645             dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
646             /*             #if ROUND == 'Loop' */
647             gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj{J},isaj{J})));
648             /*             #else */
649             gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj{J},isaj{J})));
650             /*             #endif */
651             /*                 #define INNERFLOPS INNERFLOPS+13 */
652             /*             #endif */
653             velec            = _fjsp_mul_v2r8(qq{I}{J},rinv{I}{J});
654             /*                 #define INNERFLOPS INNERFLOPS+1 */
655             /*             #if 'Force' in KERNEL_VF */
656             felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv{I}{J},fgb),rinv{I}{J});
657             /*                 #define INNERFLOPS INNERFLOPS+3 */
658             /*             #endif */
659
660             /*         #elif KERNEL_ELEC=='Ewald' */
661             /* EWALD ELECTROSTATICS */
662
663             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
664             ewrt             = _fjsp_mul_v2r8(r{I}{J},ewtabscale);
665             itab_tmp         = _fjsp_dtox_v2r8(ewrt);
666             eweps            = _fjsp_sub_v2r8(ewrt,_fjsp_xtod_v2r8(itab_tmp));
667             _fjsp_store_v2r8(&ewconv.simd,itab_tmp);
668
669             /*             #define INNERFLOPS INNERFLOPS+4 */
670             /*             #if 'Potential' in KERNEL_VF or KERNEL_MOD_ELEC=='PotentialSwitch' */
671             ewtabF           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[0] );
672             /*                 #if ROUND == 'Loop' */
673             ewtabD           = _fjsp_load_v2r8( ewtab + 4*ewconv.i[1] );
674             /*                 #else */
675             ewtabD           = _fjsp_setzero_v2r8();
676             /*                 #endif */
677             GMX_FJSP_TRANSPOSE2_V2R8(ewtabF,ewtabD);
678             ewtabV           = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[0] +2);
679             /*                 #if ROUND == 'Loop' */
680             ewtabFn          = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(), ewtab + 4*ewconv.i[1] +2);
681             /*                 #else */
682             ewtabFn          = _fjsp_setzero_v2r8();
683             /*                 #endif */
684             GMX_FJSP_TRANSPOSE2_V2R8(ewtabV,ewtabFn);
685             felec            = _fjsp_madd_v2r8(eweps,ewtabD,ewtabF);
686             /*                 #define INNERFLOPS INNERFLOPS+2 */
687             /*                 #if KERNEL_MOD_ELEC=='PotentialShift' */            
688             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
689             velec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_sub_v2r8(_fjsp_sub_v2r8(rinv{I}{J},sh_ewald),velec));
690             /*                     #define INNERFLOPS INNERFLOPS+7 */
691             /*                 #else */
692             velec            = _fjsp_nmsub_v2r8(_fjsp_mul_v2r8(ewtabhalfspace,eweps) ,_fjsp_add_v2r8(ewtabF,felec), ewtabV);
693             velec            = _fjsp_mul_v2r8(qq{I}{J},_fjsp_sub_v2r8(rinv{I}{J},velec));
694             /*                     #define INNERFLOPS INNERFLOPS+6 */
695             /*                 #endif */
696             /*                 #if 'Force' in KERNEL_VF */
697             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq{I}{J},rinv{I}{J}),_fjsp_sub_v2r8(rinvsq{I}{J},felec));
698             /*                      #define INNERFLOPS INNERFLOPS+3 */
699             /*                 #endif */
700             /*             #elif KERNEL_VF=='Force' */
701             /*                 #if ROUND == 'Loop' */
702             gmx_fjsp_load_2pair_swizzle_v2r8(ewtab+ewconv.i[0],ewtab+ewconv.i[1],
703                                          &ewtabF,&ewtabFn);
704             /*                 #else */
705             gmx_fjsp_load_1pair_swizzle_v2r8(ewtab+ewconv.i[0],&ewtabF,&ewtabFn);
706             /*                 #endif */
707             felec            = _fjsp_madd_v2r8(eweps,ewtabFn,_fjsp_nmsub_v2r8(eweps,ewtabF,ewtabF));
708             felec            = _fjsp_mul_v2r8(_fjsp_mul_v2r8(qq{I}{J},rinv{I}{J}),_fjsp_sub_v2r8(rinvsq{I}{J},felec));
709             /*                 #define INNERFLOPS INNERFLOPS+7 */
710             /*             #endif */
711
712             /*         #elif KERNEL_ELEC=='CubicSplineTable' */
713
714             /* CUBIC SPLINE TABLE ELECTROSTATICS */
715             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
716             /*             #if ROUND == 'Loop' */
717             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
718             /*             #else */
719             F                = _fjsp_setzero_v2r8();
720             /*             #endif */
721             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
722             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] +2);
723             /*             #if ROUND == 'Loop' */
724             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] +2);
725             /*             #else */
726             H                = _fjsp_setzero_v2r8();
727             /*             #endif */
728             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
729             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(vfeps,H,G),F);
730             /*             #define INNERFLOPS INNERFLOPS+4 */
731             /*             #if 'Potential' in KERNEL_VF */
732             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
733             velec            = _fjsp_mul_v2r8(qq{I}{J},VV);
734             /*                 #define INNERFLOPS INNERFLOPS+3 */
735             /*             #endif */
736             /*             #if 'Force' in KERNEL_VF */
737             FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twovfeps,H,G),vfeps,Fp);
738             felec            = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_mul_v2r8(qq{I}{J},FF),_fjsp_mul_v2r8(vftabscale,rinv{I}{J})));
739             /*                 #define INNERFLOPS INNERFLOPS+7 */
740             /*             #endif */
741             /*         #endif */
742             /*         ## End of check for electrostatics interaction forms */
743             /*     #endif */
744             /*     ## END OF ELECTROSTATIC INTERACTION CHECK FOR PAIR I-J */
745
746             /*     #if 'vdw' in INTERACTION_FLAGS[I][J] */
747
748             /*         #if KERNEL_VDW=='LennardJones' */
749
750             /* LENNARD-JONES DISPERSION/REPULSION */
751
752             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq{I}{J},rinvsq{I}{J}),rinvsq{I}{J});
753             /*             #define INNERFLOPS INNERFLOPS+2 */
754             /*             #if 'Potential' in KERNEL_VF or KERNEL_MOD_VDW=='PotentialSwitch' */
755             vvdw6            = _fjsp_mul_v2r8(c6_{I}{J},rinvsix);
756             vvdw12           = _fjsp_mul_v2r8(c12_{I}{J},_fjsp_mul_v2r8(rinvsix,rinvsix));
757             /*                 #define INNERFLOPS INNERFLOPS+3 */
758             /*                 #if KERNEL_MOD_VDW=='PotentialShift' */
759             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_{I}{J},_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
760                                            _fjsp_mul_v2r8(_fjsp_nmsub_v2r8( c6_{I}{J},sh_vdw_invrcut6,vvdw6),one_sixth));
761             /*                     #define INNERFLOPS INNERFLOPS+8 */
762             /*                 #else */
763             vvdw             = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
764             /*                     #define INNERFLOPS INNERFLOPS+3 */
765             /*                 #endif */
766             /*                 ## Check for force inside potential check, i.e. this means we already did the potential part */
767             /*                 #if 'Force' in KERNEL_VF */
768             fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq{I}{J});
769             /*                     #define INNERFLOPS INNERFLOPS+2 */
770             /*                 #endif */
771             /*             #elif KERNEL_VF=='Force' */
772             /*                 ## Force-only LennardJones makes it possible to save 1 flop (they do add up...) */
773             fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_{I}{J},rinvsix,c6_{I}{J}),_fjsp_mul_v2r8(rinvsix,rinvsq{I}{J}));
774             /*                 #define INNERFLOPS INNERFLOPS+4 */
775             /*             #endif */
776
777             /*         #elif KERNEL_VDW=='CubicSplineTable' */
778
779             /* CUBIC SPLINE TABLE DISPERSION */
780             /*             #if 'Table' in KERNEL_ELEC */
781             vfconv.i[0]       += 4;
782             vfconv.i[1]       += 4;
783             /*             #endif                     */
784             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
785             /*             #if ROUND == 'Loop' */
786             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
787             /*             #else */
788             F                = _fjsp_setzero_v2r8();
789             /*             #endif */
790             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
791             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
792             /*             #if ROUND == 'Loop' */
793             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
794             /*             #else */
795             H                = _fjsp_setzero_v2r8();
796             /*             #endif */
797             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
798             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
799             /*             #define INNERFLOPS INNERFLOPS+4 */
800             /*             #if 'Potential' in KERNEL_VF */
801             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
802             vvdw6            = _fjsp_mul_v2r8(c6_{I}{J},VV);
803             /*                 #define INNERFLOPS INNERFLOPS+3 */
804             /*             #endif */
805             /*             #if 'Force' in KERNEL_VF */
806             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
807             fvdw6            = _fjsp_mul_v2r8(c6_{I}{J},FF);
808             /*                 #define INNERFLOPS INNERFLOPS+4 */
809             /*             #endif */
810
811             /* CUBIC SPLINE TABLE REPULSION */
812             Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
813             /*             #if ROUND == 'Loop' */
814             F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
815             /*             #else */
816             F                = _fjsp_setzero_v2r8();
817             /*             #endif */
818             GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
819             G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
820             /*             #if ROUND == 'Loop' */
821             H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
822             /*             #else */
823             H                = _fjsp_setzero_v2r8();
824             /*             #endif */
825             GMX_FJSP_TRANSPOSE2_V2R8(G,H);
826             Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
827             /*             #define INNERFLOPS INNERFLOPS+4 */
828             /*             #if 'Potential' in KERNEL_VF */
829             VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
830             vvdw12           = _fjsp_mul_v2r8(c12_{I}{J},VV);
831             /*                 #define INNERFLOPS INNERFLOPS+3 */
832             /*             #endif */
833             /*             #if 'Force' in KERNEL_VF */
834             FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
835             fvdw12           = _fjsp_mul_v2r8(c12_{I}{J},FF);
836             /*                 #define INNERFLOPS INNERFLOPS+5 */
837             /*             #endif */
838             /*             #if 'Potential' in KERNEL_VF */
839             vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
840             /*                 #define INNERFLOPS INNERFLOPS+1 */
841             /*             #endif */
842             /*             #if 'Force' in KERNEL_VF */
843             fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv{I}{J})));
844             /*                 #define INNERFLOPS INNERFLOPS+4 */
845             /*             #endif */
846
847             /*         #elif KERNEL_VDW=='LJEwald' */
848
849             /* Analytical LJ-PME */
850             rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq{I}{J},rinvsq{I}{J}),rinvsq{I}{J});
851             ewcljrsq         = _fjsp_mul_v2r8(ewclj2,rsq{I}{J});
852             ewclj6           = _fjsp_mul_v2r8(ewclj2,_fjsp_mul_v2r8(ewclj2,ewclj2));
853             exponent         = gmx_simd_exp_d(ewcljrsq);
854             /* poly = exp(-(beta*r)^2) * (1 + (beta*r)^2 + (beta*r)^4 /2) */
855             poly             = _fjsp_mul_v2r8(exponent,_fjsp_madd_v2r8(_fjsp_mul_v2r8(ewcljrsq,ewcljrsq),one_half,_fjsp_sub_v2r8(one,ewcljrsq)));
856             /*                 #define INNERFLOPS INNERFLOPS+9 */
857             /*             #if 'Potential' in KERNEL_VF or KERNEL_MOD_VDW=='PotentialSwitch' */
858             /* vvdw6 = [C6 - C6grid * (1-poly)]/r6 */
859             vvdw6            = _fjsp_mul_v2r8(_fjsp_madd_v2r8(c6grid_{I}{J},_fjsp_sub_v2r8(poly,one),c6_{I}{J}),rinvsix);
860             vvdw12           = _fjsp_mul_v2r8(c12_{I}{J},_fjsp_mul_v2r8(rinvsix,rinvsix));
861             /*                 #define INNERFLOPS INNERFLOPS+5 */
862             /*                 #if KERNEL_MOD_VDW=='PotentialShift' */
863             vvdw             = _fjsp_msub_v2r8(_fjsp_nmsub_v2r8(c12_{I}{J},_fjsp_mul_v2r8(sh_vdw_invrcut6,sh_vdw_invrcut6),vvdw12),one_twelfth,
864                                _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw6,_fjsp_madd_v2r8(c6grid_{I}{J},sh_lj_ewald,_fjsp_mul_v2r8(c6_{I}{J},sh_vdw_invrcut6))),one_sixth));
865             /*                     #define INNERFLOPS INNERFLOPS+7 */
866             /*                 #else */
867             vvdw             = _fjsp_msub_v2r8(vvdw12,one_twelfth,_fjsp_mul_v2r8(vvdw6,one_sixth));         
868             /*                 #define INNERFLOPS INNERFLOPS+2 */
869             /*                 #endif */
870             /*                  ## Check for force inside potential check, i.e. this means we already did the potential part */
871             /*                  #if 'Force' in KERNEL_VF */
872             /* fvdw = vvdw12/r - (vvdw6/r + (C6grid * exponent * beta^6)/r) */
873             fvdw             = _fjsp_mul_v2r8(_fjsp_add_v2r8(vvdw12,_fjsp_msub_v2r8(_fjsp_mul_v2r8(c6grid_{I}{J},one_sixth),_fjsp_mul_v2r8(exponent,ewclj6),vvdw6)),rinvsq{I}{J});
874             /*                 #define INNERFLOPS INNERFLOPS+6 */
875             /*                  #endif */
876             /*              #elif KERNEL_VF=='Force' */
877             /* f6A = 6 * C6grid * (1 - poly) */
878             f6A              = _fjsp_mul_v2r8(c6grid_{I}{J},_fjsp_sub_v2r8(one,poly));
879             /* f6B = C6grid * exponent * beta^6 */
880             f6B              = _fjsp_mul_v2r8(_fjsp_mul_v2r8(c6grid_{I}{J},one_sixth),_fjsp_mul_v2r8(exponent,ewclj6));
881             /* fvdw = 12*C12/r13 - ((6*C6 - f6A)/r6 + f6B)/r */
882             fvdw              = _fjsp_mul_v2r8(_fjsp_madd_v2r8(_fjsp_msub_v2r8(c12_{I}{J},rinvsix,_fjsp_sub_v2r8(c6_{I}{J},f6A)),rinvsix,f6B),rinvsq{I}{J});
883             /*                 #define INNERFLOPS INNERFLOPS+12 */
884             /*              #endif */
885             /*         #endif */
886             /*         ## End of check for vdw interaction forms */
887             /*     #endif */
888             /*     ## END OF VDW INTERACTION CHECK FOR PAIR I-J */
889
890             /*     #if 'switch' in INTERACTION_FLAGS[I][J] */
891             d                = _fjsp_sub_v2r8(r{I}{J},rswitch);
892             d                = _fjsp_max_v2r8(d,_fjsp_setzero_v2r8());
893             d2               = _fjsp_mul_v2r8(d,d);
894             sw               = _fjsp_add_v2r8(one,_fjsp_mul_v2r8(d2,_fjsp_mul_v2r8(d,_fjsp_madd_v2r8(d,_fjsp_madd_v2r8(d,swV5,swV4),swV3))));
895             /*         #define INNERFLOPS INNERFLOPS+10 */
896
897             /*         #if 'Force' in KERNEL_VF */
898             dsw              = _fjsp_mul_v2r8(d2,_fjsp_madd_v2r8(d,_fjsp_madd_v2r8(d,swF4,swF3),swF2));
899             /*             #define INNERFLOPS INNERFLOPS+5 */
900             /*         #endif */
901
902             /* Evaluate switch function */
903             /*         #if 'Force' in KERNEL_VF */
904             /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
905             /*             #if 'electrostatics' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_ELEC=='PotentialSwitch' */
906             felec            = _fjsp_msub_v2r8( felec,sw , _fjsp_mul_v2r8(rinv{I}{J},_fjsp_mul_v2r8(velec,dsw)) );
907             /*                 #define INNERFLOPS INNERFLOPS+4 */
908             /*             #endif */
909             /*             #if 'vdw' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_VDW=='PotentialSwitch' */
910             fvdw             = _fjsp_msub_v2r8( fvdw,sw , _fjsp_mul_v2r8(rinv{I}{J},_fjsp_mul_v2r8(vvdw,dsw)) );
911             /*                 #define INNERFLOPS INNERFLOPS+4 */
912             /*             #endif */
913             /*         #endif */
914             /*         #if 'Potential' in KERNEL_VF */
915             /*             #if 'electrostatics' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_ELEC=='PotentialSwitch' */
916             velec            = _fjsp_mul_v2r8(velec,sw);
917             /*                 #define INNERFLOPS INNERFLOPS+1 */
918             /*             #endif */
919             /*             #if 'vdw' in INTERACTION_FLAGS[I][J] and KERNEL_MOD_VDW=='PotentialSwitch' */
920             vvdw             = _fjsp_mul_v2r8(vvdw,sw);
921             /*                 #define INNERFLOPS INNERFLOPS+1 */
922             /*             #endif */
923             /*         #endif */
924             /*     #endif */
925             /*     #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
926             cutoff_mask      = _fjsp_cmplt_v2r8(rsq{I}{J},rcutoff2);
927             /*         #define INNERFLOPS INNERFLOPS+1 */
928             /*     #endif */
929
930             /*     #if 'Potential' in KERNEL_VF */
931             /* Update potential sum for this i atom from the interaction with this j atom. */
932             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
933             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
934             velec            = _fjsp_and_v2r8(velec,cutoff_mask);
935             /*                 #define INNERFLOPS INNERFLOPS+1 */
936             /*             #endif                                       */
937             /*             #if ROUND == 'Epilogue' */
938             velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
939             /*             #endif */
940             velecsum         = _fjsp_add_v2r8(velecsum,velec);
941             /*             #define INNERFLOPS INNERFLOPS+1 */
942             /*             #if KERNEL_ELEC=='GeneralizedBorn' */
943             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
944             vgb              = _fjsp_and_v2r8(vgb,cutoff_mask);
945             /*                 #define INNERFLOPS INNERFLOPS+1 */
946             /*             #endif                                       */
947             /*             #if ROUND == 'Epilogue' */
948             vgb              = _fjsp_unpacklo_v2r8(vgb,_fjsp_setzero_v2r8());
949             /*             #endif */
950             vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
951             /*                 #define INNERFLOPS INNERFLOPS+1 */
952             /*             #endif */
953             /*         #endif */
954             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
955             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
956             vvdw             = _fjsp_and_v2r8(vvdw,cutoff_mask);
957             /*                 #define INNERFLOPS INNERFLOPS+1 */
958             /*             #endif                                       */
959             /*             #if ROUND == 'Epilogue' */
960             vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
961             /*             #endif */
962             vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
963             /*             #define INNERFLOPS INNERFLOPS+1 */
964             /*         #endif */
965             /*     #endif */
966
967             /*     #if 'Force' in KERNEL_VF */
968
969             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] and 'vdw' in INTERACTION_FLAGS[I][J] */
970             fscal            = _fjsp_add_v2r8(felec,fvdw);
971             /*             #define INNERFLOPS INNERFLOPS+1 */
972             /*         #elif 'electrostatics' in INTERACTION_FLAGS[I][J] */
973             fscal            = felec;
974             /*         #elif 'vdw' in INTERACTION_FLAGS[I][J] */
975             fscal            = fvdw;
976             /*        #endif */
977
978             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
979             fscal            = _fjsp_and_v2r8(fscal,cutoff_mask);
980             /*                 #define INNERFLOPS INNERFLOPS+1 */
981             /*             #endif                                       */
982
983             /*             #if ROUND == 'Epilogue' */
984             fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
985             /*             #endif */
986
987             /* ## Construction of vectorial force built into FMA instructions now */
988             /* #define INNERFLOPS INNERFLOPS+3      */
989             
990             /* Update vectorial force */
991             fix{I}             = _fjsp_madd_v2r8(dx{I}{J},fscal,fix{I});
992             fiy{I}             = _fjsp_madd_v2r8(dy{I}{J},fscal,fiy{I});
993             fiz{I}             = _fjsp_madd_v2r8(dz{I}{J},fscal,fiz{I});
994             /*             #define INNERFLOPS INNERFLOPS+6 */
995             
996             /* #if GEOMETRY_I == 'Particle'             */
997             /*     #if ROUND == 'Loop' */
998             gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx{I}{J},dy{I}{J},dz{I}{J});
999             /*     #else */
1000             gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx{I}{J},dy{I}{J},dz{I}{J});
1001             /*     #endif */
1002             /*     #define INNERFLOPS INNERFLOPS+3      */
1003             /* #else                                    */
1004             fjx{J}             = _fjsp_madd_v2r8(dx{I}{J},fscal,fjx{J});
1005             fjy{J}             = _fjsp_madd_v2r8(dy{I}{J},fscal,fjy{J});
1006             fjz{J}             = _fjsp_madd_v2r8(dz{I}{J},fscal,fjz{J});
1007             /*     #define INNERFLOPS INNERFLOPS+3      */
1008             /* #endif                                   */
1009
1010             /*     #endif */
1011
1012             /*     #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
1013             /*         #if 0    ## This and next two lines is a hack to maintain indentation in template file */
1014             {
1015                 /*     #endif */
1016             }
1017             /*     #endif */
1018             /*    ## End of check for the interaction being outside the cutoff */
1019
1020             /* #endfor */
1021             /* ## End of loop over i-j interaction pairs */
1022
1023             /* #if 'Water' in GEOMETRY_I and GEOMETRY_J == 'Particle' */
1024             /*     #if ROUND == 'Loop' */
1025             gmx_fjsp_decrement_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0);
1026             /*     #else */
1027             gmx_fjsp_decrement_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0);
1028             /*     #endif */
1029             /*     #define INNERFLOPS INNERFLOPS+3      */
1030             /* #elif GEOMETRY_J == 'Water3'             */
1031             /*     #if ROUND == 'Loop' */
1032             gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1033             /*     #else */
1034             gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2);
1035             /*     #endif */
1036             /*     #define INNERFLOPS INNERFLOPS+9      */
1037             /* #elif GEOMETRY_J == 'Water4'             */
1038             /*     #if 0 in PARTICLES_J                 */
1039             /*         #if ROUND == 'Loop' */
1040             gmx_fjsp_decrement_4rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1041             /*         #else */
1042             gmx_fjsp_decrement_4rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fjx0,fjy0,fjz0,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1043             /*         #endif */
1044             /*         #define INNERFLOPS INNERFLOPS+12 */
1045             /*     #else                                */
1046             /*         #if ROUND == 'Loop' */
1047             gmx_fjsp_decrement_3rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,f+j_coord_offsetB+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1048             /*         #else */
1049             gmx_fjsp_decrement_3rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA+DIM,fjx1,fjy1,fjz1,fjx2,fjy2,fjz2,fjx3,fjy3,fjz3);
1050             /*         #endif */
1051             /*         #define INNERFLOPS INNERFLOPS+9  */
1052             /*     #endif                               */
1053             /* #endif                                   */
1054
1055             /* Inner loop uses {INNERFLOPS} flops */
1056         }
1057
1058         /* #endfor */
1059
1060         /* End of innermost loop */
1061
1062         /* #if 'Force' in KERNEL_VF */
1063         /*     #if GEOMETRY_I == 'Particle'            */
1064         gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
1065                                               f+i_coord_offset,fshift+i_shift_offset);
1066         /*         #define OUTERFLOPS OUTERFLOPS+6     */
1067         /*     #elif GEOMETRY_I == 'Water3'            */
1068         gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,
1069                                               f+i_coord_offset,fshift+i_shift_offset);
1070         /*         #define OUTERFLOPS OUTERFLOPS+18    */
1071         /*     #elif GEOMETRY_I == 'Water4'            */
1072         /*         #if 0 in PARTICLES_I                */
1073         gmx_fjsp_update_iforce_4atom_swizzle_v2r8(fix0,fiy0,fiz0,fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1074                                               f+i_coord_offset,fshift+i_shift_offset);
1075         /*             #define OUTERFLOPS OUTERFLOPS+24    */
1076         /*         #else                               */
1077         gmx_fjsp_update_iforce_3atom_swizzle_v2r8(fix1,fiy1,fiz1,fix2,fiy2,fiz2,fix3,fiy3,fiz3,
1078                                               f+i_coord_offset+DIM,fshift+i_shift_offset);
1079         /*             #define OUTERFLOPS OUTERFLOPS+18    */
1080         /*         #endif                              */
1081         /*     #endif                                  */
1082         /* #endif                                      */
1083
1084         /* #if 'Potential' in KERNEL_VF */
1085         ggid                        = gid[iidx];
1086         /* Update potential energies */
1087         /*     #if KERNEL_ELEC != 'None' */
1088         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
1089         /*         #define OUTERFLOPS OUTERFLOPS+1 */
1090         /*     #endif */
1091         /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
1092         gmx_fjsp_update_1pot_v2r8(vgbsum,kernel_data->energygrp_polarization+ggid);
1093         /*         #define OUTERFLOPS OUTERFLOPS+1 */
1094         /*     #endif */
1095         /*     #if KERNEL_VDW != 'None' */
1096         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
1097         /*         #define OUTERFLOPS OUTERFLOPS+1 */
1098         /*     #endif */
1099         /* #endif */
1100         /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
1101         dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai{I},isai{I}));
1102         gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
1103         /*     #endif */
1104
1105         /* Increment number of inner iterations */
1106         inneriter                  += j_index_end - j_index_start;
1107
1108         /* Outer loop uses {OUTERFLOPS} flops */
1109     }
1110
1111     /* Increment number of outer iterations */
1112     outeriter        += nri;
1113
1114     /* Update outer/inner flops */
1115     /* ## NB: This is not important, it just affects the flopcount. However, since our preprocessor is */
1116     /* ## primitive and replaces aggressively even in strings inside these directives, we need to      */
1117     /* ## assemble the main part of the name (containing KERNEL/ELEC/VDW) directly in the source.      */
1118     /* #if GEOMETRY_I == 'Water3'            */
1119     /*     #define ISUFFIX '_W3'             */
1120     /* #elif GEOMETRY_I == 'Water4'          */
1121     /*     #define ISUFFIX '_W4'             */
1122     /* #else                                 */
1123     /*     #define ISUFFIX ''                */
1124     /* #endif                                */
1125     /* #if GEOMETRY_J == 'Water3'            */
1126     /*     #define JSUFFIX 'W3'              */
1127     /* #elif GEOMETRY_J == 'Water4'          */
1128     /*     #define JSUFFIX 'W4'              */
1129     /* #else                                 */
1130     /*     #define JSUFFIX ''                */
1131     /* #endif                                */
1132     /* #if 'PotentialAndForce' in KERNEL_VF  */
1133     /*     #define VFSUFFIX  '_VF'           */
1134     /* #elif 'Potential' in KERNEL_VF        */
1135     /*     #define VFSUFFIX '_V'             */
1136     /* #else                                 */
1137     /*     #define VFSUFFIX '_F'             */
1138     /* #endif                                */
1139
1140     /* #if KERNEL_ELEC != 'None' and KERNEL_VDW != 'None' */
1141     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW{ISUFFIX}{JSUFFIX}{VFSUFFIX},outeriter*{OUTERFLOPS} + inneriter*{INNERFLOPS});
1142     /* #elif KERNEL_ELEC != 'None' */
1143     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC{ISUFFIX}{JSUFFIX}{VFSUFFIX},outeriter*{OUTERFLOPS} + inneriter*{INNERFLOPS});
1144     /* #else */
1145     inc_nrnb(nrnb,eNR_NBKERNEL_VDW{ISUFFIX}{JSUFFIX}{VFSUFFIX},outeriter*{OUTERFLOPS} + inneriter*{INNERFLOPS});
1146     /* #endif  */
1147 }