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/kDataTransfer.cu
Let me know if you run into any troubles.
Best,
Delaram
________________________________________
From: ÕźÆíµ <zhanghaomiao.hust.edu.cn>
Sent: Wednesday, December 26, 2018 4:12 AM
To: amber.ambermd.org
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.ambermd.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.ambermd.org_mailman_listinfo_amber&d=DwICAg&c=pZJPUDQ3SB9JplYbifm4nt2lEVG5pWx2KikqINpWlZM&r=VvQy5PCXKJaGqwIFOxrZfrBLHWzuw9VxhPTw_bbTkzg&m=Rp2BTD-t3LRG9cubo2dyDE16caHnnF1XLRZAadaWMJM&s=pOA5Q9YEISB9DBQdgamaBCQYeccV8exnoAsiWoO3Nsk&e=
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Dec 26 2018 - 10:30:02 PST