[gmx-developers] GPU kernel code

Mahmood Naderan nt_mahmood at yahoo.com
Thu Apr 25 15:13:19 CEST 2019


OK I found that you are referring to ....kernels.cuh while I was looking at ....kernel.cuh. There, I see

/* cut-off + V shift LJ w LB combination rules */
#define LJ_COMB_LB
#define NB_KERNEL_FUNC_NAME(x, ...) x ## _ElecEw_VdwLJCombLB ## __VA_ARGS__
#include FLAVOR_LEVEL_GENERATOR



That is the kernel name and how that is run in nbnxn_cuda_kernel.cuh is what I described in the previous post and you confirmed that.
Thank you very much. 


Regards,
Mahmood 

    On Thursday, April 25, 2019, 5:21:50 PM GMT+4:30, Berk Hess <hess at kth.se> wrote:  
 
  Also, you are grepping for LJ_Comb, not LJComb as Szilard suggested.
 
 Cheers,
 
 Berk
 
 On 25/04/2019 14.48, Szilárd Páll wrote:
  
 
    
  
   
  
  On Thu, Apr 25, 2019 at 2:43 PM Mahmood Naderan <nt_mahmood at yahoo.com> wrote:
  
    > Selection happens at runtime, see in nbnxn_cuda.cu:select_nbnxn_kernel(). 
  Yes I see that. 
  
   
  
  > Try "git grep LJComb". 
  I am trying to find that in 2018.2 release that I have currently. 
  mahmood at mpc:/opt/gromacs-2018.2/src/gromacs/mdlib/nbnxn_cuda$ grep -i LJ_Comb nbnxn_cuda_kernel.cuh
 #if defined LJ_COMB_GEOM || defined LJ_COMB_LB
 #define LJ_COMB
 #ifndef LJ_COMB
     const float2       *lj_comb     = atdat.lj_comb;
 #ifndef LJ_COMB
 #if !defined LJ_COMB_LB || defined CALC_ENERGIES
 #ifdef LJ_COMB_LB
 #ifndef LJ_COMB
 #ifndef LJ_COMB
         ljcpib[tidxj * c_clSize + tidxi] = lj_comb[ai];
 #ifndef LJ_COMB
                     ljcp_j  = lj_comb[aj];
 #ifndef LJ_COMB
 #ifdef LJ_COMB_GEOM
 #endif                          /* LJ_COMB_GEOM */
 #endif                          /* LJ_COMB */
 #if !defined LJ_COMB_LB || defined CALC_ENERGIES
 #else                           /* !LJ_COMB_LB || CALC_ENERGIES */
 #endif                          /* !LJ_COMB_LB || CALC_ENERGIES */
 #undef LJ_COMB
mahmood at mpc:/opt/gromacs-2018.2/src/gromacs/mdlib/nbnxn_cuda$ grep -i LJComb nbnxn_cuda_kernel.cuh
  mahmood at mpc:/opt/gromacs-2018.2/src/gromacs/mdlib/nbnxn_cuda$     
 
  As suggested before, grep the source repo, not that one file; or grep the right file -- the one I recommended looking at in my previous email  (src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh).   
     
  
  
  
  I expect that VdwLJCombLB_F means that the statements that must be executed in nbnxn_cuda_kernel.cuh, are those that are used in defined macros.     
 
  Correct. In fact the "VdwLJCombLB" kenrnels will not even have e.g. VdwLJFsw  (i.e. LJ force switch) code included in them.   
     
  For example, since I see Vdw, the following code must be executed 
  #ifdef VDW_CUTOFF_CHECK
                                 /* Separate VDW cut-off check to enable twin-range cut-offs
                                  * (rvdw < rcoulomb <= rlist)
                                  */
                                 vdw_in_range  = (r2 < rvdw_sq) ? 1.0f : 0.0f;
                                 F_invr       *= vdw_in_range;
 
  
  
  Also, since LJCombLB is seen, the following code must be executed
  
  
  #else                           /* !LJ_COMB_LB || CALC_ENERGIES */
                                 float sig_r  = sigma*inv_r;
                                 float sig_r2 = sig_r*sig_r;
                                 float sig_r6 = sig_r2*sig_r2*sig_r2;
    
  
  
  
  And so on... 
  Please let me know if I still haven't understand that. 
 
  
  Regards,
 Mahmood  
   
   
      
  
 -- 
Gromacs Developers mailing list

* Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!

* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists

* For (un)subscribe requests visit
https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request at gromacs.org.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20190425/f670e757/attachment.html>


More information about the gromacs.org_gmx-developers mailing list