Re: [AMBER-Developers] Cuda code, Re: coda code help

From: David Cerutti <dscerutti.gmail.com>
Date: Tue, 29 Oct 2019 00:26:13 -0400

When the code is in SPFP mode and the force switched Lennard-Jones
potential is not engaged, the code is making use of a log-adaptive spline
table to compute d/dr [ erfc(a * r) / r ]. It's one of my optimizations.
The log-adaptive table can store all of the relevant range, indexed as a
function of r2, in 3-4kb of chip cache on the GPU SMs, so the bulk of the
direct space computation collapses to a table lookup and three fmult ops.
There are two separate tables: one for exclusions, the other for standard
interactions. The exclusions spline table folds in the 1/r removal term,
and this is in fact why the splines are MORE numerically precise than
analytic computations in fp32 (SPFP) mode.

https://pubs.acs.org/doi/10.1021/acs.jcim.8b00462

Dave


On Mon, Oct 28, 2019 at 7:01 PM Yong Duan <duan.ucdavis.edu> wrote:

>
> Sorry, should be "cuda" instead ...
>
> yd
>
>
>
> On 10/28/19, 2:09 PM, "Yong Duan" <duan.ucdavis.edu> wrote:
>
>
>
> Greetings from windy west coast!
>
> I come across these lines in src/pmemd/src/cuda/kNLCPNE.h and realize
> that I need some help after struggling for a while.
>
> Following lines deal with exclusions. For PME_ENERGY case, by
> propagating the correction via b0 and b1, line 365 removes both the
> energies and forces of what should be excluded reciprocal terms. For other
> cases, the force terms should also be removed. However, for (use_SPFP) &&
> !(PME_FSWITCH), swtch is not used. How it does the trick? Any hint?
>
> yd
> src/pmemd/src/cuda/kNLCPNE.h
>
> 363: #if defined(use_DPFP) || defined(PME_FSWITCH) ||
> defined(PME_ENERGY)
> 364: else {
> 365: swtch -= (PMEFloat)1.0;
> 366: }
> 367: #endif
> // This ends a branch for "not an exclusion"--the non-bonded
> interaction is
> // to be counted. 0x1 is simply 1 in hexadecimal.
>
> 371: #ifdef PME_ENERGY
> 372: PMEFloat b0 = qiqj * swtch * rinv;
> 373: PMEFloat b1 = b0 - qiqj * d_swtch_dx;
> 374: df += b1 * r2inv;
> 375: # ifdef use_SPFP
> 376: TLeed += fnrange * b0;
> 377: # else // use_DPFP
> 378: eed.pmef += fnrange * b0;
> 379: # endif
> 380: #else // PME_ENERGY
> 381: # if defined(use_SPFP) && !defined(PME_FSWITCH)
> 382: df += qiqj * d_swtch_dx;
> 383: # else
> 384: df += qiqj * (swtch * rinv - d_swtch_dx) * r2inv;
> 385: # endif
> 386: #endif // PME_ENERGY
>
>
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers
>
>
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers
>
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Oct 28 2019 - 21:30:02 PDT
Custom Search