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