[gmx-developers] grompp .mdp processing

Anton Feenstra feenstra at few.vu.nl
Tue Feb 24 00:30:36 CET 2009


Mark Abraham wrote:
>>> $sed "s/TINIT/${tinit}/" template.mdp | sed "s/TSTEP/${tstep}/" | sed
>>> "s/NSTEPS/${nsteps}/" | sed "s/SAVE_FREQUENCY/${save_frequency}/" >
>>> actual.mdp
>>
>> sed -e "/^tinit/s/=.*/= $TINIT/" -e "/^nsteps/s/=.*/= $NSTEPS/" ...
>> template.mdp > new.mdp
>>
>> No need for a template with named variables... (and no need for piping
>> sed output to sed input).
> 
> Thanks! I'd never seen this "/grepmatch/s/original/replacement/" syntax 
> before. It runs rings around some of my sed monstrosities.

My big 'doit' script actually calls cpp to do this kind of processing, 
generating from a 'mother.mdp' several instances, like
cpp -D _EM ../mother.mdp > em.mdp

#ifdefs and #defines in the 'mother.mdp' handle all (most) of the dirty 
stuff. Works great for consistency!

This gives almost exactly the functionality described by Sander (without 
the multiple variable setting).

If anything, for users' convenience a wrapper script around grompp could 
catch this without burdoning the grompp code with it.

My half a dime worth, I think the intricacies of cpp processing of the 
topology files are bad enough, but in that case there is compelling 
reason to have that additional processing layer. For a mere options list 
(however long), I think it is shooting mosquitoes with cannons.


-- 
Groetjes,

Anton
  _____________ _______________________________________________________
|             |                                                       |
|  _   _  ___,| K. Anton Feenstra                                     |
| / \ / \'| | | IBIVU/Bioinformatics - Free University  Amsterdam     |
|(   |   )| | | De Boelelaan 1083A - 1081 HV Amsterdam - Netherlands  |
| \_/ \_/ | | | Tel +31 20 59 87783 - Fax +31 20 59 87653 - Room P136 |
|             | Feenstra at few.vu.nl - www.few.vu.nl/~feenstra/         |
|             | "You Could Be a Shadow" (The Breeders)                |
|_____________|_______________________________________________________|



More information about the gromacs.org_gmx-developers mailing list