[gmx-developers] GPU kernel code

Szilárd Páll pall.szilard at gmail.com
Thu Apr 25 14:48:46 CEST 2019


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
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20190425/7ebc43bb/attachment.html>


More information about the gromacs.org_gmx-developers mailing list