Re: Question regarding NAMD nonbonded routines

From: Peter Freddolino (
Date: Fri Jul 27 2007 - 11:41:08 CDT

Hi Vincent,
sorry for the slow reply this time. And no problem, although in some
cases you're getting into parts of the code that I'm less familiar with,
so my answers are probably less helpful this time around (most of what
I've had to tweak in namd has been in the force calculation routines).

> Googling for X-PLOR and NAMD turns up [1], which mentions that the "C2
> switching function implemented in NAMD and described in " [2], which is
> S(r) =
> case (r < r_s): 1
> case (r >= r_c): 0
> otherwise: 1 + R^2 * (2R - 3)
> where R = (r - r_s) / (r_c - r_s), where r_c is the cutoff distance and
> r_s is the shift distance. Inspecting the code (ComputeNonbondedUtil.C)
> suggests that this is correct, but I might easily be missing something
> and would like to confirm this.
If you have long-range electrostatics on then the one you gave is
correct; if not, then the function E_switch = E_vac * (1 - r / r_off)2
is used instead.

> b) I think I now understand (thanks to the paper and your answers) how
> "patches" and "compute objects" interact. It looks like a very nice
> system, though I have to admit I would not have figured it out from the
> code ;-) There seems to be a third important component in that game,
> which I don't quite understand yet (and for which I would greatly
> appreciate a quick explanation): the "reduction manager" (
> ). I
> have a hunch it's responsible for collecting the results of individual
> compute objects. Can you confirm this?
Honestly, I've never looked deeply at this part of the program, so your
reading of the code is probably as good as mine, but this sounds
consistent with my understanding: The reduction manager receives data
from the compute objects and collects energy/force information and the
information needed for things like pressure calculations.
> c) I don't think I quite understand the pairlist construction algorithm
> yet. I can see that the partitioning of the system into patches gets it
> down to O(N)-scaling, but some comments in the code ("// add remaining
> atoms to pairlist via hydrogen groups") suggest I might missing some of
> the details. Do I understand it correctly that (i) the pairlist of
> particles in a given patch are constructed based on particles in the
> same patch as well as particles in the neighboring patches; (ii)
> interatomic (rather than inter-group) distances are used in the pairlist
> construction; (iii) the above comment refers to the assignment of
> hydrogens to patches based on the atoms they are bound to?
Again, this isn't a part of the code that I've looked at much. For i I
think you're correct, note that the patches are decomposed spatially
based on the cutoff distance (plus a bit of padding) so that you can be
sure that everything within the cutoff distance is within the home patch
or its neighbors. Hydrogens get grouped into patches based on their
parent atoms *unless* splitpatch is set to "position" (in which case
they can be placed in patches separately), but the pairlists are based
on interatomic distances. If you're assigning hydrogens to patches based
on the parent atom, though (which is the default), I believe that
inter-group distances are used for pairlist construction, rather than
what you suggest in (ii); to compensate for this, the value of
hgroupCutoff is added to the cutoff for the purposes of group-group
pairlist construction (this value is also added to the margin padding
the patch sizes to ensure that the assumption that only adjacent patches
need be considered in pairlist construction is correct). The comment
that troubles you refers to this practice.

> Thank you very much!
> Kind regards,
> v.
> [1] @ARTICLE{Izaguirre1999,
> author = {J.A. Izaguirre and S. Reich and R.D. Skeel},
> title = {{Longer time steps for molecular dynamics}},
> journal = {J. Chem. Phys.},
> year = {1999},
> volume = {110},
> pages = {9853},
> }
> [2] @ARTICLE{Humphreys1994,
> author = {D. D. Humphreys and R. A. Friesner and B. J. Berne},
> title = {{A Multiple-Time-Step Molecular Dynamics Algorithm for
> Macromolecules}},
> journal = {J. Phys. Chem.},
> year = {1994},
> volume = {98},
> pages = {6885-6892},
> }

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:45:00 CST