Commit 36e79dc
Interaction Energy calculation on GPU for GIST (#787)
* Added GPU Compatibility to GIST
Added changes in the Makefile of the CUDA code, to include the correct
compilation of the GIST CUDA implementation.
The call to the GPU is done as an extra function, instead of the call to
NonbondEnergy, NonbondCuda is called. Since the NonbondCuda also
directly can calculate the order parameters, the function Order is also
replaced by the single call to NonbondCuda.
I added #ifdef statements around each change, so that the changes are
only effecting the code, when compiled with CUDA. If the code is
compiled without CUDA, the code is exactly the same as in the cpptraj
implementation.
Some further new functions were added to the implementation, so that the
NonbondCuda can be called easily from the rest of the code.
These functions include a possibility to free the GPUMemory
(freeGPUMemory) from the main program, a function to copy stuff from
the Host memory to the CUDA capable device (copyToGPU).
A few more variables were added, which are used for copying of data to
and from the GPU, and keeping track of a variety of atom parameters
(like charge, atom type, ...).
Most of the time, when working on the host memory, the vector class from
the STL is used, this is not true for the solvent_ array. The reason for
this is a feature concerning vector<bool>, which is not an array holding
boolean values, but a bit string, where at each bit, one true or false
value is stored. For copying the memory to the device, the use of this
functionality is not an option, thus the solvent_ array remains an
allocated array in the host memory.
The source files for the device code were implemented in the same way as
in GIGIST (compare www.github.com/liedllab/gigist). However, they were
all moved together into the cuda_kernels.
In the RunTest.sh, a different test for the CUDA version is supplied.
Actually, everything stays the same, except for the comparison with
Eww_ij, which is not calculated on the GPU, for memory reasons and thus
can also not be tested against. This is done by using the CheckEnv
function to recognize the cuda and notcuda keywords for the Requires and
CheckFor statements. The answer to why the Eww_ij is not implemented on
the GPU is quite simple: Consider the following example.
If a grid is constructed, consisting of 100 x 100 x 100 voxels, with a
grid spacing of 0.5 Angstrom, this is actually just a box of size 50 x
50 x 50 Angstrom. But if one would calculated the entire Eww_ij matrix
for this kind of calculation, a total of 10^12 data points would need to
be saved. This results from the calculation to compare each voxel with
each other. Given 100 x 100 x 100 voxels, this results in (10^6)^2 data
points, which evaluates to 10^12. At each data point, a value for the
energy has to be stored, when using ASCII-code, this will probably take
about 10 characters, resulting in a final file size of 10TB (and this
does not even consider the 4TB of memory that would be needed).
* Added skipS flag
A flag to skip the entropy calculation was added. Also, the indentation
was fixed for all files.
* Updated Documentation, Change Version
Added a paragraph with a couple of tips for the GPU implementation and
also added a statement concerning the new skipS keyword.
Changed the version number of cpptraj in src/Version.h to 4.25.0.
* Changes to comply with reviews by @drroe
- Removed ConstantsG.cuh
- Fixed printf error
- Added gist to the CUDA enabled commands
Co-authored-by: Daniel R. Roe <daniel.r.roe@gmail.com>1 parent 060a3b4 commit 36e79dc
File tree
12 files changed
+1659
-183
lines changed- doc
- src
- cuda_kernels
- test
- Test_GIST
12 files changed
+1659
-183
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1174 | 1174 | | |
1175 | 1175 | | |
1176 | 1176 | | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
1177 | 1181 | | |
1178 | 1182 | | |
1179 | 1183 | | |
| |||
22490 | 22494 | | |
22491 | 22495 | | |
22492 | 22496 | | |
22493 | | - | |
| 22497 | + | |
22494 | 22498 | | |
22495 | 22499 | | |
22496 | 22500 | | |
| |||
22543 | 22547 | | |
22544 | 22548 | | |
22545 | 22549 | | |
| 22550 | + | |
| 22551 | + | |
| 22552 | + | |
| 22553 | + | |
22546 | 22554 | | |
22547 | 22555 | | |
22548 | 22556 | | |
| |||
22922 | 22930 | | |
22923 | 22931 | | |
22924 | 22932 | | |
| 22933 | + | |
| 22934 | + | |
| 22935 | + | |
| 22936 | + | |
| 22937 | + | |
| 22938 | + | |
| 22939 | + | |
| 22940 | + | |
| 22941 | + | |
| 22942 | + | |
| 22943 | + | |
| 22944 | + | |
| 22945 | + | |
| 22946 | + | |
| 22947 | + | |
| 22948 | + | |
| 22949 | + | |
| 22950 | + | |
| 22951 | + | |
| 22952 | + | |
| 22953 | + | |
22925 | 22954 | | |
22926 | 22955 | | |
22927 | 22956 | | |
| |||
0 commit comments