#include "gromacs/math/calculate-ewald-splitting-coefficient.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
-#include "gromacs/mdlib/nbnxn_consts.h"
+#include "gromacs/mdlib/nb_verlet.h"
+#include "gromacs/mdlib/nbnxn_search.h"
#include "gromacs/mdlib/nbnxn_simd.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.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/simd.h"
-#endif
-
-
/* The code in this file estimates a pairlist buffer length
* given a target energy drift per atom per picosecond.
* This is done by estimating the drift given a buffer length.
gmx_bool bGPU,
verletbuf_list_setup_t *list_setup)
{
+ /* When calling this function we often don't know which kernel type we
+ * are going to use. W choose the kernel type with the smallest possible
+ * i- and j-cluster sizes, so we potentially overestimate, but never
+ * underestimate, the buffer drift.
+ * Note that the current buffer estimation code only handles clusters
+ * of size 1, 2 or 4, so for 4x8 or 8x8 we use the estimate for 4x4.
+ */
+
if (bGPU)
{
- list_setup->cluster_size_i = NBNXN_GPU_CLUSTER_SIZE;
- list_setup->cluster_size_j = NBNXN_GPU_CLUSTER_SIZE;
+ /* The CUDA kernels split the j-clusters in two halves */
+ list_setup->cluster_size_i = nbnxn_kernel_to_ci_size(nbnxnk8x8x8_GPU);
+ list_setup->cluster_size_j = nbnxn_kernel_to_cj_size(nbnxnk8x8x8_GPU)/2;
}
else
{
- list_setup->cluster_size_i = NBNXN_CPU_CLUSTER_I_SIZE;
- list_setup->cluster_size_j = NBNXN_CPU_CLUSTER_I_SIZE;
+ int kernel_type;
+
+ kernel_type = nbnxnk4x4_PlainC;
+
#ifdef GMX_NBNXN_SIMD
if (bSIMD)
{
- list_setup->cluster_size_j = GMX_SIMD_REAL_WIDTH;
#ifdef GMX_NBNXN_SIMD_2XNN
- /* We assume the smallest cluster size to be on the safe side */
- list_setup->cluster_size_j /= 2;
+ /* We use the smallest cluster size to be on the safe side */
+ kernel_type = nbnxnk4xN_SIMD_2xNN;
+#else
+ kernel_type = nbnxnk4xN_SIMD_4xN;
#endif
}
#endif
+
+ list_setup->cluster_size_i = nbnxn_kernel_to_ci_size(kernel_type);
+ list_setup->cluster_size_j = nbnxn_kernel_to_cj_size(kernel_type);
}
}
#include "gromacs/mdlib/forcerec-threading.h"
#include "gromacs/mdlib/nb_verlet.h"
#include "gromacs/mdlib/nbnxn_atomdata.h"
-#include "gromacs/mdlib/nbnxn_consts.h"
#include "gromacs/mdlib/nbnxn_gpu_data_mgmt.h"
#include "gromacs/mdlib/nbnxn_search.h"
#include "gromacs/mdlib/nbnxn_simd.h"
{
fprintf(fp, "\nUsing %s %dx%d non-bonded kernels\n\n",
lookup_nbnxn_kernel_name(*kernel_type),
- nbnxn_kernel_pairlist_simple(*kernel_type) ? NBNXN_CPU_CLUSTER_I_SIZE : NBNXN_GPU_CLUSTER_SIZE,
+ nbnxn_kernel_to_ci_size(*kernel_type),
nbnxn_kernel_to_cj_size(*kernel_type));
if (nbnxnk4x4_PlainC == *kernel_type ||
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
extern "C" {
#endif
+/* Returns the i-cluster size for kernel of type nb_kernel_type */
+int nbnxn_kernel_to_ci_size(int nb_kernel_type);
+
/* Returns the j-cluster size for kernel of type nb_kernel_type */
int nbnxn_kernel_to_cj_size(int nb_kernel_type);