Move PairlistSet declaration
authorBerk Hess <hess@kth.se>
Mon, 18 Mar 2019 15:25:26 +0000 (16:25 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 28 Mar 2019 11:23:39 +0000 (12:23 +0100)
Moved the declaration of PairlistSet to pairlistset.h.
Also completed the documentation.

Change-Id: I0cac4bbf1919b4a2f39d8ead63aa75f112ab60c7

src/gromacs/nbnxm/kerneldispatch.cpp
src/gromacs/nbnxm/nbnxm.cpp
src/gromacs/nbnxm/nbnxm_setup.cpp
src/gromacs/nbnxm/pairlist.cpp
src/gromacs/nbnxm/pairlist.h
src/gromacs/nbnxm/pairlistset.h
src/gromacs/nbnxm/pairsearch.h
src/gromacs/nbnxm/prunekerneldispatch.cpp

index 6b40e39048d79f50f61049d46792c298f23e9830..5d099ea6dfbb2591dfbf51e4113acce5f57cef08 100644 (file)
 #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"
index 1d486c60bc0e7eef92549e2e37575fa80c54bf79..eab38e59f34271a971e7fa05cc44f77a1189d783 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/nbnxm/atomdata.h"
 #include "gromacs/timing/wallcycle.h"
 
+#include "pairlistset.h"
 #include "pairlistsets.h"
 #include "pairsearch.h"
 
index 5d6576dcf83226d0554f781e439ba3c2ef1dfb0d..794f6f98d42b06d9d1ed71deb465bf837d258d18 100644 (file)
 #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"
 
index 847cf591d8832c9a3a20dc18fad56ba4ba74b162..e0b6fd2416b36477db9e9d53ffe72e865a754f26 100644 (file)
@@ -59,7 +59,6 @@
 #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"
@@ -71,6 +70,7 @@
 #include "gromacs/utility/smalloc.h"
 
 #include "gridset.h"
+#include "pairlistset.h"
 #include "pairlistsets.h"
 #include "pairlistwork.h"
 #include "pairsearch.h"
index 5ef25591193c532d466305c01e87c95cb4991da2..da19d70f9e208a8eaf3054508847c902ce23e29b 100644 (file)
 
 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>
@@ -292,92 +281,6 @@ struct NbnxnPairlistGpu
     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          &params_;
-        //! 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);
 
index a35db0f83598be98f409f3a2bc81418ded29d31f..1eea57d0e44d08a90b7f387d5c7330c433332bf6 100644 (file)
  * 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          &params_;
+        //! 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
index 7dcf54712d8dece1bc6c3fdf8237865d51a54924..f67037058fdcbbe7ea909edb92e52a1171d9a9db 100644 (file)
@@ -65,6 +65,7 @@
 #include "gridset.h"
 
 struct gmx_domdec_zones_t;
+struct PairsearchWork;
 
 
 /*! \brief Convenience declaration for an std::vector with aligned memory */
index 76482e16479a5e241430d8b4e1efa17b0c94fd04..2ee9a5186115cb74a8235f18f42f540f1a01866b 100644 (file)
@@ -37,9 +37,9 @@
 
 #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"