[gmx-developers] Where is do_func() defined in the code (for mdp read in, I think)
Mark Abraham
Mark.Abraham at anu.edu.au
Fri Oct 31 08:06:04 CET 2008
Jochen Hub wrote:
> chris.neale at utoronto.ca wrote:
>> Hello,
>>
>> I am working my way through the gromacs code with gmx-4.0 and I have a
>> question about how information is read in from the .mdp file.
>>
>> I find do_inputrec() in tpxio.c, which calls do_int() or do_real(), etc.
>> These appear to be special cases of do_func() as defined in
>> include/gmxfio.h
>>
>> However, I can not find the meat of do_func() anywhere in the src or
>> include directories.
>
> In such cases I usually use:
>
> find . -name "*.[hc]" -exec grep do_func {} \; -print
Nice one. I have a perl script for the same purpose...
#!/usr/bin/perl -w
use strict;
my $grepfiles = join(' ', split(/\n/, `ls src/*/*.[ch] include/*.h
include/*/*.h src/gmxlib/nonbonded/nb_kernel*/*.[ch]
src/gmxlib/nonbonded/*.[ch]`));
foreach my $text ( @ARGV ) {
print `grep '$text' $grepfiles`;
}
Your "find" idiom is more elegant. My approach allows for multiple
search keys supplied on the command line. If I ever encountered a more
complex need, I'd make it handle regexps too!
Mark
More information about the gromacs.org_gmx-developers
mailing list