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

From: Yong Duan <duan.ucdavis.edu>
Date: Mon, 28 Oct 2019 23:01:10 +0000


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
Received on Mon Oct 28 2019 - 16:30:01 PDT
Custom Search