[gmx-users] Re: Calculate individual force between each atom pair

Erik Lindahl lindahl at cbr.su.se
Mon May 21 09:55:57 CEST 2007


On May 20, 2007, at 11:50 PM, WU Yanbin wrote:

>   Thanks for the suggestions.
>   I have traced the calling sequence from do_force() to calculate  
> LJ forces: do_force() -->force() -->do_nonbonded(). But in  
> do_nonbonded() function of nonbonded.c file, if for general  
> processor, it should have call gmx_nb_generic_kernel() function but  
> this line is in fact commented and the implimentation of  
> gmx_nb_generic_kernel() can not be found. My gromacs version is v3.3.
>   So is there previous implementation of this function? I can write  
> it myself but the efficiency will be much lower. Any suggestions?  
> Thanks in advance.

No, the "generic" loop is actually something new we haven't  
implemented yet (well, only partly at least).

The idea is to have three levels of optimization, depending both on  
the architecture and how complicated/custom interactions you want to do.

1. For common simulation setups on common hardware you will run the  
manually tuned assembly kernels.
2. When that isn't possible, we have a wider selection of  
automatically generated kernels in C/Fortran (the nb_kernel  
directory). These are somewhat optimized for different hardware when  
it comes to prefetching, the 1/sqrt(x) calls, but do not use any  
inline assembly.
3. If you want to do esoteric interactions such as multipoles or hack  
your own functional form, we intend to have a "generic" C-language  
kernel with a switch statement for the type of interaction inside the  
innermost loop. This is not good for performance, but it should be  
straightforward both to understand and hack, not to mention it can be  
faster than using tables for the interactions.

For reference, have a look at the 1,4-interactions routine to see  
what it would look like.



More information about the gromacs.org_gmx-users mailing list