[gmx-developers] trajana.h trajana.c

Mark Abraham mark.abraham at anu.edu.au
Wed Apr 11 13:32:43 CEST 2012


 
 
On 11/04/12, Paolo Franz <paolo.franz at gmail.com> wrote:

> Thanks for the answer. Am I correct in saying that if I want to activate two options (say ANA_USE_TOPX  and ANA_NOUSER_PBC, which might not make any sense!) for a trajectory, I need to call gmx_ana_traj_create with flags=ANA_USE_TOPX | ANA_NOUSER_PBC?  
> 
> 
> Sorry if my questions are silly, I am more familiar with c++ than c and I have used rarely bitwise operations.
> 

 
Yes, that's the kind of usage expected. For the record, c++ does do this kind of thing too (e.g. stl::bit_vector, which will be replaced with a template specialization eventually) but in a non-HPC C++ context one is less concerned about things like cache footprint.
 

> 
>  
> Cheers
> Paolo
> 
> 
> On 11 April 2012 11:26, Tsjerk Wassenaar <tsjerkw at gmail.com> wrote:
> 
> 
> > Hi Paolo,
> > 
> > If you use masking and other bitwise operations, it is handy to know
> > which bit is set; the second for ANA_USE_TOPX and the fifth for
> > ANA_NOUSER_PBC. Of course it's equal to 2 and 16, but that notation
> > makes it a bit less obvious what to do with bitwise operations.
> 
> 
> 

 
And by the time you get to the 13th option people might not know the value of 2^13 - much better to write an equivalent version that suggests how the value is intended to be used. 
 
Mark 
 

> 
> 
> 
> 
> 
> > 
> > 
> > Cheers,
> > 
> > Tsjerk
> > 
> > 
> > 
> > On Wed, Apr 11, 2012 at 11:18 AM, Paolo Franz <paolo.franz at gmail.com> wrote:
> > > Hello everybody,
> > > For sometimes, I have been developing analysis tools for gromacs
> > > trajectories using the gromacs library. I am puzzled about some definitions
> > > in the file trajana.h, which I do not seem to understand completely. Why are
> > > definitions such as
> > >
> > > #define ANA_USE_TOPX         (1<<1)
> > >
> > > #define ANA_NOUSER_PBC       (1<<4)
> > >
> > > used in the code? What is the purpose of this bitwise shift - why not set
> > > ANA_USE_TOPX and ANA_NOUSER_PBC to 2 and 16 for instance??
> > >
> > > Thanks in advance
> > >
> > > Paolo
> > >
> > >
> > >
> > 
> > 
> > > --
> > > gmx-developers mailing list
> > > gmx-developers at gromacs.org
> > > http://lists.gromacs.org/mailman/listinfo/gmx-developers
> > > Please don't post (un)subscribe requests to the list. Use the
> > > www interface or send it to gmx-developers-request at gromacs.org.
> > 
> > 
> > 
> > --
> > Tsjerk A. Wassenaar, Ph.D.
> > 
> > post-doctoral researcher
> > Molecular Dynamics Group
> > * Groningen Institute for Biomolecular Research and Biotechnology
> > * Zernike Institute for Advanced Materials
> > University of Groningen
> > The Netherlands
> > --
> > gmx-developers mailing list
> > gmx-developers at gromacs.org
> > http://lists.gromacs.org/mailman/listinfo/gmx-developers
> > Please don't post (un)subscribe requests to the list. Use the
> > www interface or send it 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/20120411/3cb1119d/attachment.html>


More information about the gromacs.org_gmx-developers mailing list