Re: [AMBER] GPU download(upload) only a small subset of coordinates

From: Ghoreishi, Delaram <>
Date: Wed, 26 Dec 2018 18:22:41 +0000

Hi Zhang Haomiao.

Actually, this functionality is already released in Amber18. The functions that partially upload or download the information of a list of atoms are included in $AMBERHOME/src/pmemd/src/cuda/gpu.cpp.

First, you need to set up the information regarding your partial download via gpu_setup_shuttle_info_(int* nshatom, int* infocode, int atom_list[]) function. The atom_list argument is a sorted array of the atom numbers of the atoms you wish to transfer their information, and nshatom should be the number of atoms in atm_list. infocode should be set to 0.

gpu_shuttle_retrieve_data_(double atm_data[][3], int* flag) is the function that partially downloads the information. The atm_data argument is the array that holds the information, this could be forces or coordinates (frc or crd in the Fortran code). The flag argument specifies the type of information that is transferred:
0: coordinates come down
1: aggregate forces come down
2: forces due to bonded interactions come down
3: forces due to non-bonded interactions come down

gpu_shuttle_post_data_(double atm_data[][3], int* flag) is the function that partially uploads the information. For detailed information regarding the flag argument please take a look at the comment section of the kPostSimData function inside $AMBERHOME/src/pmemd/src/cuda/

Let me know if you run into any troubles.


From: ź <>
Sent: Wednesday, December 26, 2018 4:12 AM
Subject: [AMBER] GPU download(upload) only a small subset of coordinates

Hello everyone:

Currently, I use the command PMEMD.cuda to simulate my system.

And It's known that It's a waste of time to copy device(CUDA) data to Host frequently.

Every time I use the command gpu_download_crd, it downloads all of the coordinates of atoms.

But, in my system, I only need a small subset of atoms to download to my host and modify them, then upload it.

To my way of thinking, it would decrease the simulation time if I could download a small subset of atoms. Is my idea right? And it's possible for me to do this? If possible, how can I modify the source code to provide this ability?

Zhang Haomiao

Huazhong University of Science and Technology

AMBER mailing list
AMBER mailing list
Received on Wed Dec 26 2018 - 10:30:02 PST
Custom Search