From acbbcc1367fdb43e7404884e79882f01b296598b Mon Sep 17 00:00:00 2001 From: Alan Gray Date: Wed, 8 Jan 2020 08:37:17 -0800 Subject: [PATCH] Fix memory address bug in GPU PME coordinate address send fn Fixes bug introduced in 8f80571986c5ba98e4070ab390d372e81078cc3a, which changed a pointer from rvec to float type, but didn't change the corresponding array index used to get the pointer to send: an extra multiplication by DIM is required. Change-Id: Ia16e9988cb154895807a3c9f9588b1ffe59b3dcc --- src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu b/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu index fd55c832ff..88d7af569b 100644 --- a/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu +++ b/src/gromacs/ewald/pme_coordinate_receiver_gpu_impl.cu @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019, by the GROMACS development team, led by + * Copyright (c) 2019,2020, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -83,7 +83,7 @@ void PmeCoordinateReceiverGpu::Impl::sendCoordinateBufferAddressToPpRanks(const ind_end = ind_start + receiver.numAtoms; // Data will be transferred directly from GPU. - void* sendBuf = reinterpret_cast(&d_x[ind_start]); + void* sendBuf = reinterpret_cast(&d_x[ind_start * DIM]); #if GMX_MPI MPI_Send(&sendBuf, sizeof(void**), MPI_BYTE, receiver.rankId, 0, comm_); -- 2.11.4.GIT