From: Szilard Pall Date: Mon, 27 May 2013 17:37:18 +0000 (+0200) Subject: minor function argument cleanup X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=5fdd50080a8bb8b701af1b2a33a29fe2023d0794;p=alexxy%2Fgromacs.git minor function argument cleanup Removed an unused function argument and changed anoehter one to not pass the entire nonbonded verlet data structure to the nbnxn_cuda module, but only what's needed from it. Change-Id: I89699548f69245eba6d8451683ba6dc36af75dc2 --- diff --git a/include/nbnxn_cuda_data_mgmt.h b/include/nbnxn_cuda_data_mgmt.h index 0d8ce3d0c8..e542ed978e 100644 --- a/include/nbnxn_cuda_data_mgmt.h +++ b/include/nbnxn_cuda_data_mgmt.h @@ -66,9 +66,9 @@ void nbnxn_cuda_init(FILE *fplog, /*! Initializes simulation constant data. */ FUNC_QUALIFIER -void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t p_cu_nb, - const interaction_const_t *ic, - const nonbonded_verlet_t *nbv) FUNC_TERM +void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t cu_nb, + const interaction_const_t *ic, + const nonbonded_verlet_group_t *nbv_group) FUNC_TERM /*! Initializes pair-list data for GPU, called at every pair search step. */ FUNC_QUALIFIER diff --git a/src/kernel/runner.c b/src/kernel/runner.c index d9bfae0482..ff98cfba63 100644 --- a/src/kernel/runner.c +++ b/src/kernel/runner.c @@ -630,7 +630,6 @@ static void increase_nstlist(FILE *fp, t_commrec *cr, static void prepare_verlet_scheme(FILE *fplog, gmx_hw_info_t *hwinfo, t_commrec *cr, - gmx_hw_opt_t *hw_opt, const char *nbpu_opt, t_inputrec *ir, const gmx_mtop_t *mtop, @@ -987,7 +986,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, if (inputrec->cutoff_scheme == ecutsVERLET) { - prepare_verlet_scheme(fplog, hwinfo, cr, hw_opt, nbpu_opt, + prepare_verlet_scheme(fplog, hwinfo, cr, nbpu_opt, inputrec, mtop, state->box, &minf.bUseGPU); } diff --git a/src/mdlib/forcerec.c b/src/mdlib/forcerec.c index 2253eb1051..2c2e4da07b 100644 --- a/src/mdlib/forcerec.c +++ b/src/mdlib/forcerec.c @@ -1863,7 +1863,7 @@ void init_interaction_const(FILE *fp, if (fr->nbv != NULL && fr->nbv->bUseGPU) { - nbnxn_cuda_init_const(fr->nbv->cu_nbv, ic, fr->nbv); + nbnxn_cuda_init_const(fr->nbv->cu_nbv, ic, fr->nbv->grp); } bUsesSimpleTables = uses_simple_tables(fr->cutoff_scheme, fr->nbv, -1); diff --git a/src/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu b/src/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu index f2d427b18c..a7ef47ce2e 100644 --- a/src/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu +++ b/src/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu @@ -237,13 +237,13 @@ static int pick_ewald_kernel_type(bool bTwinCut, /*! Initializes the nonbonded parameter data structure. */ static void init_nbparam(cu_nbparam_t *nbp, const interaction_const_t *ic, - const nonbonded_verlet_t *nbv, + const nbnxn_atomdata_t *nbat, const cuda_dev_info_t *dev_info) { cudaError_t stat; int ntypes, nnbfp; - ntypes = nbv->grp[0].nbat->ntype; + ntypes = nbat->ntype; nbp->ewald_beta = ic->ewaldcoeff; nbp->sh_ewald = ic->sh_ewald; @@ -284,7 +284,7 @@ static void init_nbparam(cu_nbparam_t *nbp, nnbfp = 2*ntypes*ntypes; stat = cudaMalloc((void **)&nbp->nbfp, nnbfp*sizeof(*nbp->nbfp)); CU_RET_ERR(stat, "cudaMalloc failed on nbp->nbfp"); - cu_copy_H2D(nbp->nbfp, nbv->grp[0].nbat->nbfp, nnbfp*sizeof(*nbp->nbfp)); + cu_copy_H2D(nbp->nbfp, nbat->nbfp, nnbfp*sizeof(*nbp->nbfp)); cudaChannelFormatDesc cd = cudaCreateChannelDesc(); stat = cudaBindTexture(NULL, &nbnxn_cuda_get_nbfp_texref(), @@ -642,12 +642,12 @@ void nbnxn_cuda_init(FILE *fplog, } } -void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t cu_nb, - const interaction_const_t *ic, - const nonbonded_verlet_t *nbv) +void nbnxn_cuda_init_const(nbnxn_cuda_ptr_t cu_nb, + const interaction_const_t *ic, + const nonbonded_verlet_group_t *nbv_group) { - init_atomdata_first(cu_nb->atdat, nbv->grp[0].nbat->ntype); - init_nbparam(cu_nb->nbparam, ic, nbv, cu_nb->dev_info); + init_atomdata_first(cu_nb->atdat, nbv_group[0].nbat->ntype); + init_nbparam(cu_nb->nbparam, ic, nbv_group[0].nbat, cu_nb->dev_info); /* clear energy and shift force outputs */ nbnxn_cuda_clear_e_fshift(cu_nb);