[gmx-users] limit on energygrp_table
adrien.leygue at gmail.com
Wed Oct 10 16:29:57 CEST 2007
Thanks for your suggestions,
I have gone for the solution where I change the type of group numbers
from uchars to unsigned short.
It seems however that this solution is not very elegant:
I fail to understand the logic of limiting the number of groups in the
energygrp_table field to 254. Indeed the energygrp_table field is made
of pairs of groups. So if the group numbers are stored as uchar the
number of possible pairwise interactions between those groups is much
greater than 254 (of the order of 2^16 and not 2^8).
I am actually in that case: I have not too many groups (~20) so I can
store all the numbers in a uchar but when I generate all possible
pairwise interactions I have to input something like 400 group names
under energygrp_table and then grompp complains.
> >-Is there a way to increase this limit (by changing a constant and
> >then recompile) ? or is it more complicated (from the value 254 one
> >could guess that there is some one one-byte optimization)
> This is indeed a on-byte optimization.
> The group numbers are stored as uchars (include/types/atoms.h).
> You could change this, then you also have to change 2 or more other files
> for the io and communication of these numbers.
I have modified include/types/atoms.h
Then it seemed logical to also change the following lines in src/kernel/readir.c
#define MAXPTR 65534
#define NOGID 65535
to account for the new limits.
I can compile the modified code and run grompp without a warning on my
system. The only strange thing is that grompp complains if I do not
provide tablep*.xvg files even though I want to use the same tabulated
potentials for my inter and intra (defined through some pairs)
molecular non-bonded potentials.
Nevertheless when I try to run some energy minimization it directly
complains that my first 1-4 interaction is beyond table range of 0
nm,... and will ignore all 1-4 (i assume it means pairs).
This message seems really odd,... especially the 0nm part.
I have probably to propagate the change of type to more files. I
welcome all suggestions.
Department of Materials Science and Engineering
School of Chemical Engineering
National Technical University of Athens
9 Heroon Polytechniou Street
Zografou Campus, Athens 157 80,
Tel/Fax: +30210 772-3112
More information about the gromacs.org_gmx-users