From fa86e44f90940aa13648dc86db08e7597e6fe229 Mon Sep 17 00:00:00 2001 From: Martin Bauernfeind Date: Mon, 4 Jul 2022 19:36:09 +0200 Subject: [PATCH] Fixed wrong number of threadblock being launched --- src/pbc.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pbc.cu b/src/pbc.cu index 2ded42f..ff60634 100644 --- a/src/pbc.cu +++ b/src/pbc.cu @@ -125,7 +125,7 @@ void updatePbc_cuda(Atom *atom, Parameter *param, Atom *c_atom, bool doReneighbo MD_FLOAT yprd = param->yprd; MD_FLOAT zprd = param->zprd; - const int num_blocks = ceil((float)atom->Nlocal / (float)num_threads_per_block); + const int num_blocks = ceil((float)atom->Nghost / (float)num_threads_per_block); /*__global__ void computePbcUpdate(Atom a, int* PBCx, int* PBCy, int* PBCz, * MD_FLOAT xprd, MD_FLOAT yprd, MD_FLOAT zprd) @@ -241,4 +241,4 @@ void growPbc(Atom *atom) { PBCy = (int *) reallocate(PBCy, ALIGNMENT, NmaxGhost * sizeof(int), nold * sizeof(int)); PBCz = (int *) reallocate(PBCz, ALIGNMENT, NmaxGhost * sizeof(int), nold * sizeof(int)); } -} \ No newline at end of file +}