[gmx-developers] Where can I define a truly global variable?

Lee-Ping leeping at MIT.EDU
Tue Aug 7 15:10:26 CEST 2007


Thanks a lot.  I just might try that. :)  I think that the nonbonded kernels
don't have the forcerec, but I can probably try a slightly different
strategy with that.

- Lee-Ping

-----Original Message-----
From: gmx-developers-bounces at gromacs.org
[mailto:gmx-developers-bounces at gromacs.org] On Behalf Of David van der Spoel
Sent: Monday, August 06, 2007 10:06 AM
To: Discussion list for GROMACS development
Subject: Re: [gmx-developers] Where can I define a truly global variable?

Lee-Ping wrote:
> Dear community,
>
> I'm trying to add a feature to GROMACS which involves a variable being
> passed between all of the bonded and nonbonded force functions (in the
same
> way that the total potential energy is passed).  I thought of increasing
the
> number of variables with which each function is declared, but that leads
to
> an immense amount of errors since each piece of code is intimately linked
to
> so many others.  Currently I'm working around this problem by having each
> force function print numbers to a file, but this involves printf
statements
> in the inner loops, which the program is not very happy about (it slows
down
> considerably).  The other solution is to make the variable truly global,
so
> I don't need to pass it between functions, but where would I declare a
> variable so global that I can, for example, call it from
> nonbonded_kernel330_c.c if I declared it in md.c or force.c?  Is this even
> possible?  If not, is there anywhere I can declare such a global variable
> (maybe in a .h file?)  Your input is appreciated.  Thanks,
>   
you can try adding it to the forcerec because it goes fromthe highest 
level almost down to the inner loops.

_______________________________________________
gmx-developers mailing list
gmx-developers at gromacs.org
http://www.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.




More information about the gromacs.org_gmx-developers mailing list