Moved the declaration of PairlistSet to pairlistset.h.
Also completed the documentation.
Change-Id: I0cac4bbf1919b4a2f39d8ead63aa75f112ab60c7
#include "gromacs/nbnxm/gpu_data_mgmt.h"
#include "gromacs/nbnxm/nbnxm.h"
#include "gromacs/nbnxm/nbnxm_simd.h"
-#include "gromacs/nbnxm/pairlist.h"
#include "gromacs/nbnxm/kernels_reference/kernel_gpu_ref.h"
#include "gromacs/simd/simd.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/real.h"
#include "kernel_common.h"
+#include "pairlistset.h"
#include "pairlistsets.h"
#define INCLUDE_KERNELFUNCTION_TABLES
#include "gromacs/nbnxm/kernels_reference/kernel_ref.h"
#include "gromacs/nbnxm/atomdata.h"
#include "gromacs/timing/wallcycle.h"
+#include "pairlistset.h"
#include "pairlistsets.h"
#include "pairsearch.h"
#include "gromacs/nbnxm/nbnxm_simd.h"
#include "gromacs/nbnxm/pairlist.h"
#include "gromacs/nbnxm/pairlist_tuning.h"
-#include "gromacs/nbnxm/pairlistset.h"
#include "gromacs/simd/simd.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/logger.h"
#include "gpu_types.h"
#include "grid.h"
+#include "pairlistset.h"
#include "pairlistsets.h"
#include "pairsearch.h"
#include "gromacs/nbnxm/nbnxm.h"
#include "gromacs/nbnxm/nbnxm_geometry.h"
#include "gromacs/nbnxm/nbnxm_simd.h"
-#include "gromacs/nbnxm/pairlistset.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/simd/simd.h"
#include "gromacs/utility/smalloc.h"
#include "gridset.h"
+#include "pairlistset.h"
#include "pairlistsets.h"
#include "pairlistwork.h"
#include "pairsearch.h"
struct NbnxnPairlistCpuWork;
struct NbnxnPairlistGpuWork;
-struct nbnxn_atomdata_t;
-struct PairlistParams;
-struct PairsearchWork;
-struct SearchCycleCounting;
-struct t_blocka;
-struct t_nrnb;
-
-namespace Nbnxm
-{
-class GridSet;
-enum class KernelType;
-}
+
/* Convenience type for vector with aligned memory */
template<typename T>
gmx_cache_protect_t cp1;
};
-/*! \internal
- * \brief An object that holds the local or non-local pairlists
- */
-class PairlistSet
-{
- public:
- //! Constructor: initializes the pairlist set as empty
- PairlistSet(Nbnxm::InteractionLocality locality,
- const PairlistParams &listParams);
-
- ~PairlistSet();
-
- //! Constructs the pairlists in the set using the coordinates in \p nbat
- void constructPairlists(const Nbnxm::GridSet &gridSet,
- gmx::ArrayRef<PairsearchWork> searchWork,
- nbnxn_atomdata_t *nbat,
- const t_blocka *excl,
- Nbnxm::KernelType kernelType,
- int minimumIlistCountForGpuBalancing,
- t_nrnb *nrnb,
- SearchCycleCounting *searchCycleCounting);
-
- //! Dispatch the kernel for dynamic pairlist pruning
- void dispatchPruneKernel(const nbnxn_atomdata_t *nbat,
- const rvec *shift_vec,
- Nbnxm::KernelType kernelType);
-
- //! Returns the locality
- Nbnxm::InteractionLocality locality() const
- {
- return locality_;
- }
-
- //! Returns the lists of CPU pairlists
- gmx::ArrayRef<const NbnxnPairlistCpu> cpuLists() const
- {
- return cpuLists_;
- }
-
- //! Returns a pointer to the GPU pairlist, nullptr when not present
- const NbnxnPairlistGpu *gpuList() const
- {
- if (!gpuLists_.empty())
- {
- return &gpuLists_[0];
- }
- else
- {
- return nullptr;
- }
- }
-
- //! Returns the lists of free-energy pairlists, empty when nonbonded interactions are not perturbed
- gmx::ArrayRef<t_nblist const * const> fepLists() const
- {
- return fepLists_;
- }
-
- private:
- //! The locality of the pairlist set
- Nbnxm::InteractionLocality locality_;
- //! List of pairlists in CPU layout
- std::vector<NbnxnPairlistCpu> cpuLists_;
- //! List of working list for rebalancing CPU lists
- std::vector<NbnxnPairlistCpu> cpuListsWork_;
- //! List of pairlists in GPU layout
- std::vector<NbnxnPairlistGpu> gpuLists_;
- //! Pairlist parameters describing setup and ranges
- const PairlistParams ¶ms_;
- //! Tells whether multiple lists get merged into one (the first) after creation
- bool combineLists_;
- //! Tells whether the lists is of CPU type, otherwise GPU type
- gmx_bool isCpuType_;
- //! Lists for perturbed interactions in simple atom-atom layout
- std::vector<t_nblist *> fepLists_;
-
- public:
- /* Pair counts for flop counting */
- //! Total number of atom pairs for LJ+Q kernel
- int natpair_ljq_;
- //! Total number of atom pairs for LJ kernel
- int natpair_lj_;
- //! Total number of atom pairs for Q kernel
- int natpair_q_;
-};
-
//! Initializes a free-energy pair-list
void nbnxn_init_pairlist_fep(t_nblist *nl);
* the research papers on the package. Check out http://www.gromacs.org.
*/
+/*! \internal \file
+ *
+ * \brief
+ * Declares the PairlistSet class
+ *
+ * There is one PairlistSet object per locality. A PairlistSet
+ * holds a list of CPU- or GPU-type pairlist objects, one for each thread,
+ * as well as helper objects to construct each of those pairlists.
+ *
+ * \author Berk Hess <hess@kth.se>
+ * \ingroup module_nbnxm
+ */
+
#ifndef GMX_NBNXM_PAIRLISTSET_H
#define GMX_NBNXM_PAIRLISTSET_H
#include "locality.h"
-/* Tells if the pair-list corresponding to nb_kernel_type is simple.
- * Returns FALSE for super-sub type pair-list.
+struct PairlistParams;
+struct PairsearchWork;
+struct SearchCycleCounting;
+struct t_nrnb;
+
+namespace Nbnxm
+{
+class GridSet;
+}
+
+/*! \internal
+ * \brief An object that holds the local or non-local pairlists
*/
-gmx_bool nbnxn_kernel_pairlist_simple(int nb_kernel_type);
+class PairlistSet
+{
+ public:
+ //! Constructor: initializes the pairlist set as empty
+ PairlistSet(Nbnxm::InteractionLocality locality,
+ const PairlistParams &listParams);
+
+ ~PairlistSet();
+
+ //! Constructs the pairlists in the set using the coordinates in \p nbat
+ void constructPairlists(const Nbnxm::GridSet &gridSet,
+ gmx::ArrayRef<PairsearchWork> searchWork,
+ nbnxn_atomdata_t *nbat,
+ const t_blocka *excl,
+ Nbnxm::KernelType kernelType,
+ int minimumIlistCountForGpuBalancing,
+ t_nrnb *nrnb,
+ SearchCycleCounting *searchCycleCounting);
+
+ //! Dispatch the kernel for dynamic pairlist pruning
+ void dispatchPruneKernel(const nbnxn_atomdata_t *nbat,
+ const rvec *shift_vec,
+ Nbnxm::KernelType kernelType);
+
+ //! Returns the locality
+ Nbnxm::InteractionLocality locality() const
+ {
+ return locality_;
+ }
+
+ //! Returns the lists of CPU pairlists
+ gmx::ArrayRef<const NbnxnPairlistCpu> cpuLists() const
+ {
+ return cpuLists_;
+ }
+
+ //! Returns a pointer to the GPU pairlist, nullptr when not present
+ const NbnxnPairlistGpu *gpuList() const
+ {
+ if (!gpuLists_.empty())
+ {
+ return &gpuLists_[0];
+ }
+ else
+ {
+ return nullptr;
+ }
+ }
+
+ //! Returns the lists of free-energy pairlists, empty when nonbonded interactions are not perturbed
+ gmx::ArrayRef<t_nblist const * const> fepLists() const
+ {
+ return fepLists_;
+ }
+
+ private:
+ //! The locality of the pairlist set
+ Nbnxm::InteractionLocality locality_;
+ //! List of pairlists in CPU layout
+ std::vector<NbnxnPairlistCpu> cpuLists_;
+ //! List of working list for rebalancing CPU lists
+ std::vector<NbnxnPairlistCpu> cpuListsWork_;
+ //! List of pairlists in GPU layout
+ std::vector<NbnxnPairlistGpu> gpuLists_;
+ //! Pairlist parameters describing setup and ranges
+ const PairlistParams ¶ms_;
+ //! Tells whether multiple lists get merged into one (the first) after creation
+ bool combineLists_;
+ //! Tells whether the lists is of CPU type, otherwise GPU type
+ gmx_bool isCpuType_;
+ //! Lists for perturbed interactions in simple atom-atom layout
+ std::vector<t_nblist *> fepLists_;
+
+ public:
+ /* Pair counts for flop counting */
+ //! Total number of atom pairs for LJ+Q kernel
+ int natpair_ljq_;
+ //! Total number of atom pairs for LJ kernel
+ int natpair_lj_;
+ //! Total number of atom pairs for Q kernel
+ int natpair_q_;
+};
#endif
#include "gridset.h"
struct gmx_domdec_zones_t;
+struct PairsearchWork;
/*! \brief Convenience declaration for an std::vector with aligned memory */
#include "gromacs/mdlib/gmx_omp_nthreads.h"
#include "gromacs/nbnxm/nbnxm.h"
-#include "gromacs/nbnxm/pairlist.h"
#include "gromacs/utility/gmxassert.h"
+#include "pairlistset.h"
#include "pairlistsets.h"
#include "kernels_reference/kernel_ref_prune.h"
#include "kernels_simd_2xmm/kernel_prune.h"