From 66992d87defc0e54840822f3a91b685c432e138c Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Wed, 20 Feb 2019 09:42:00 +0100 Subject: [PATCH] Minor nbnxm cleanup Removed typedef nbnxn_search_t and unused alloc/free functions. Change-Id: I07436fd909867d2db9ff41b741b4ebc218623858 --- src/gromacs/nbnxm/grid.cpp | 4 ++-- src/gromacs/nbnxm/nbnxm.h | 5 +++-- src/gromacs/nbnxm/pairlist.cpp | 9 --------- src/gromacs/nbnxm/pairlist.h | 14 -------------- src/gromacs/nbnxm/pairlistset.h | 24 ------------------------ 5 files changed, 5 insertions(+), 51 deletions(-) diff --git a/src/gromacs/nbnxm/grid.cpp b/src/gromacs/nbnxm/grid.cpp index 7ccf6d18c5..4b98d53a3c 100644 --- a/src/gromacs/nbnxm/grid.cpp +++ b/src/gromacs/nbnxm/grid.cpp @@ -1539,7 +1539,7 @@ void nbnxn_put_on_grid_nonlocal(nonbonded_verlet_t *nbv, } } -void nbnxn_get_ncells(nbnxn_search_t nbs, int *ncx, int *ncy) +void nbnxn_get_ncells(const nbnxn_search *nbs, int *ncx, int *ncy) { *ncx = nbs->grid[0].numCells[XX]; *ncy = nbs->grid[0].numCells[YY]; @@ -1555,7 +1555,7 @@ gmx::ArrayRef nbnxn_get_atomorder(const nbnxn_search *nbs) return gmx::constArrayRefFromArray(nbs->a.data(), numIndices); } -void nbnxn_set_atomorder(nbnxn_search_t nbs) +void nbnxn_set_atomorder(nbnxn_search *nbs) { /* Set the atom order for the home cell (index 0) */ nbnxn_grid_t *grid = &nbs->grid[0]; diff --git a/src/gromacs/nbnxm/nbnxm.h b/src/gromacs/nbnxm/nbnxm.h index 640d782b93..e0103c849d 100644 --- a/src/gromacs/nbnxm/nbnxm.h +++ b/src/gromacs/nbnxm/nbnxm.h @@ -118,6 +118,7 @@ struct gmx_hw_info_t; struct gmx_mtop_t; struct interaction_const_t; struct nbnxn_pairlist_set_t; +struct nbnxn_search; struct nonbonded_verlet_t; struct t_blocka; struct t_commrec; @@ -352,13 +353,13 @@ void nbnxn_put_on_grid_nonlocal(nonbonded_verlet_t *nb_verlet, gmx::ArrayRef x); /*! \brief Returns the number of x and y cells in the local grid */ -void nbnxn_get_ncells(nbnxn_search_t nbs, int *ncx, int *ncy); +void nbnxn_get_ncells(const nbnxn_search *nbs, int *ncx, int *ncy); /*! \brief Returns the order indices of the atoms on the pairlist search grid */ gmx::ArrayRef nbnxn_get_atomorder(const nbnxn_search* nbs); /*! \brief Renumbers the atom indices on the grid to consecutive order */ -void nbnxn_set_atomorder(nbnxn_search_t nbs); +void nbnxn_set_atomorder(nbnxn_search *nbs); /*! \brief Returns the index position of the atoms on the pairlist search grid */ gmx::ArrayRef nbnxn_get_gridindices(const nbnxn_search* nbs); diff --git a/src/gromacs/nbnxm/pairlist.cpp b/src/gromacs/nbnxm/pairlist.cpp index 06293a0261..8365163e24 100644 --- a/src/gromacs/nbnxm/pairlist.cpp +++ b/src/gromacs/nbnxm/pairlist.cpp @@ -332,15 +332,6 @@ nbnxn_search::nbnxn_search(int ePBC, nbs_cycle_clear(cc); } -nbnxn_search *nbnxn_init_search(int ePBC, - const ivec *n_dd_cells, - const gmx_domdec_zones_t *zones, - gmx_bool bFEP, - int nthread_max) -{ - return new nbnxn_search(ePBC, n_dd_cells, zones, bFEP, nthread_max); -} - static void init_buffer_flags(nbnxn_buffer_flags_t *flags, int natoms) { diff --git a/src/gromacs/nbnxm/pairlist.h b/src/gromacs/nbnxm/pairlist.h index 71d90b3883..d54708150e 100644 --- a/src/gromacs/nbnxm/pairlist.h +++ b/src/gromacs/nbnxm/pairlist.h @@ -139,20 +139,6 @@ typedef struct { int dummy[16]; } gmx_cache_protect_t; -/* Abstract type for pair searching data */ -typedef struct nbnxn_search * nbnxn_search_t; - -/* Function that should return a pointer *ptr to memory - * of size nbytes. - * Error handling should be done within this function. - */ -typedef void nbnxn_alloc_t (void **ptr, size_t nbytes); - -/* Function that should free the memory pointed to by *ptr. - * NULL should not be passed to this function. - */ -typedef void nbnxn_free_t (void *ptr); - /* This is the actual cluster-pair list j-entry. * cj is the j-cluster. * The interaction bits in excl are indexed i-major, j-minor. diff --git a/src/gromacs/nbnxm/pairlistset.h b/src/gromacs/nbnxm/pairlistset.h index e2da79e853..82bcdef6e1 100644 --- a/src/gromacs/nbnxm/pairlistset.h +++ b/src/gromacs/nbnxm/pairlistset.h @@ -42,31 +42,7 @@ #include "locality.h" -struct gmx_domdec_zones_t; -struct gmx_groups_t; -struct nbnxn_atomdata_t; struct nbnxn_pairlist_set_t; -struct nbnxn_search; -struct t_blocka; -struct t_nrnb; - -/* Function that should return a pointer *ptr to memory - * of size nbytes. - * Error handling should be done within this function. - */ -typedef void nbnxn_alloc_t (void **ptr, size_t nbytes); - -/* Function that should free the memory pointed to by *ptr. - * NULL should not be passed to this function. - */ -typedef void nbnxn_free_t (void *ptr); - -/* Allocates and initializes a pair search data structure */ -nbnxn_search *nbnxn_init_search(int ePBC, - const ivec *n_dd_cells, - const gmx_domdec_zones_t *zones, - gmx_bool bFEP, - int nthread_max); /* Initializes a set of pair lists stored in nbnxn_pairlist_set_t * -- 2.22.0