#ifndef _nbnxn_internal_h
#define _nbnxn_internal_h
-#include "typedefs.h"
-#include "domdec.h"
+#include "gromacs/legacyheaders/domdec.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+#include "gromacs/mdlib/nbnxn_simd.h"
#include "gromacs/timing/cyclecounter.h"
-#ifdef GMX_NBNXN_SIMD
-/* The include below sets the SIMD instruction type (precision+width)
- * for all nbnxn SIMD search and non-bonded kernel code.
- */
-#ifdef GMX_NBNXN_HALF_WIDTH_SIMD
-#define GMX_USE_HALF_WIDTH_SIMD_HERE
-#endif
-#include "gromacs/simd/macros.h"
-#endif
-
-/* Bounding box calculations are (currently) always in single precision.
+/* Bounding box calculations are (currently) always in single precision, so
+ * we only need to check for single precision support here.
* This uses less (cache-)memory and SIMD is faster, at least on x86.
*/
-#define GMX_SIMD4_SINGLE
-/* Include the 4-wide SIMD macro file */
-#include "gromacs/simd/four_wide_macros.h"
-/* Check if we have 4-wide SIMD macro support */
-#ifdef GMX_HAVE_SIMD4_MACROS
+#ifdef GMX_SIMD4_HAVE_FLOAT
#define NBNXN_SEARCH_BB_SIMD4
#endif
/* A pair-search grid struct for one domain decomposition zone */
typedef struct {
- rvec c0; /* The lower corner of the (local) grid */
- rvec c1; /* The upper corner of the (local) grid */
- real atom_density; /* The atom number density for the local grid */
-
- gmx_bool bSimple; /* Is this grid simple or super/sub */
- int na_c; /* Number of atoms per cluster */
- int na_cj; /* Number of atoms for list j-clusters */
- int na_sc; /* Number of atoms per super-cluster */
- int na_c_2log; /* 2log of na_c */
-
- int ncx; /* Number of (super-)cells along x */
- int ncy; /* Number of (super-)cells along y */
- int nc; /* Total number of (super-)cells */
-
- real sx; /* x-size of a (super-)cell */
- real sy; /* y-size of a (super-)cell */
- real inv_sx; /* 1/sx */
- real inv_sy; /* 1/sy */
-
- int cell0; /* Index in nbs->cell corresponding to cell 0 */
-
- int *cxy_na; /* The number of atoms for each column in x,y */
- int *cxy_ind; /* Grid (super)cell index, offset from cell0 */
- int cxy_nalloc; /* Allocation size for cxy_na and cxy_ind */
-
- int *nsubc; /* The number of sub cells for each super cell */
- float *bbcz; /* Bounding boxes in z for the super cells */
- nbnxn_bb_t *bb; /* 3D bounding boxes for the sub cells */
- nbnxn_bb_t *bbj; /* 3D j-bounding boxes for the case where *
- * the i- and j-cluster sizes are different */
- float *pbb; /* 3D b. boxes in xxxx format per super cell */
- int *flags; /* Flag for the super cells */
- int nc_nalloc; /* Allocation size for the pointers above */
-
- float *bbcz_simple; /* bbcz for simple grid converted from super */
- nbnxn_bb_t *bb_simple; /* bb for simple grid converted from super */
- int *flags_simple; /* flags for simple grid converted from super */
- int nc_nalloc_simple; /* Allocation size for the pointers above */
-
- int nsubc_tot; /* Total number of subcell, used for printing */
+ rvec c0; /* The lower corner of the (local) grid */
+ rvec c1; /* The upper corner of the (local) grid */
+ real atom_density; /* The atom number density for the local grid */
+
+ gmx_bool bSimple; /* Is this grid simple or super/sub */
+ int na_c; /* Number of atoms per cluster */
+ int na_cj; /* Number of atoms for list j-clusters */
+ int na_sc; /* Number of atoms per super-cluster */
+ int na_c_2log; /* 2log of na_c */
+
+ int ncx; /* Number of (super-)cells along x */
+ int ncy; /* Number of (super-)cells along y */
+ int nc; /* Total number of (super-)cells */
+
+ real sx; /* x-size of a (super-)cell */
+ real sy; /* y-size of a (super-)cell */
+ real inv_sx; /* 1/sx */
+ real inv_sy; /* 1/sy */
+
+ int cell0; /* Index in nbs->cell corresponding to cell 0 */
+
+ int *cxy_na; /* The number of atoms for each column in x,y */
+ int *cxy_ind; /* Grid (super)cell index, offset from cell0 */
+ int cxy_nalloc; /* Allocation size for cxy_na and cxy_ind */
+
+ int *nsubc; /* The number of sub cells for each super cell */
+ float *bbcz; /* Bounding boxes in z for the super cells */
+ nbnxn_bb_t *bb; /* 3D bounding boxes for the sub cells */
+ nbnxn_bb_t *bbj; /* 3D j-bounding boxes for the case where *
+ * the i- and j-cluster sizes are different */
+ float *pbb; /* 3D b. boxes in xxxx format per super cell */
+ int *flags; /* Flag for the super cells */
+ unsigned int *fep; /* FEP signal bits for sub cells */
+ int nc_nalloc; /* Allocation size for the pointers above */
+
+ float *bbcz_simple; /* bbcz for simple grid converted from super */
+ nbnxn_bb_t *bb_simple; /* bb for simple grid converted from super */
+ int *flags_simple; /* flags for simple grid converted from super */
+ int nc_nalloc_simple; /* Allocation size for the pointers above */
+
+ int nsubc_tot; /* Total number of subcell, used for printing */
} nbnxn_grid_t;
#ifdef GMX_NBNXN_SIMD
int ndistc; /* Number of distance checks for flop counting */
+ t_nblist *nbl_fep; /* Temporary FEP list for load balancing */
+
nbnxn_cycle_t cc[enbsCCnr];
gmx_cache_protect_t cp1;
/* Main pair-search struct, contains the grid(s), not the pair-list(s) */
typedef struct nbnxn_search {
+ gmx_bool bFEP; /* Do we have perturbed atoms? */
int ePBC; /* PBC type enum */
matrix box; /* The periodic unit-cell */