Project

General

Profile

Bug #428

grompp stores t_ilist.i_atoms wrong for position restraints

Added by Erik Marklund over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

I was about to fix bug 334, but realized that it goes back to some weirdness going on in grompp, or rather the tpr file it generates. It seems that i_atoms[] in the t_ilist holds strange things. This is what I found when debugging g_hbond:

...
(gdb) p top->idef.il[44].iatoms[0]
$31 = 0
(gdb) p top->idef.il[44].iatoms[1]
$32 = 450
(gdb) p top->idef.il[44].iatoms[2]
$33 = 1
(gdb) p top->idef.il[44].iatoms[3]
$34 = 465
...

il44 is the ilist for position restraints as seen below.

(gdb) p interaction_function[44].longname 
$35 = 0x5fa4ad "Position Rest."

In the first snippet of output we saw how the first entry in il44 dereferenced function type 0, which is not a position restraint. Look here for yourself:

(gdb) p top->idef.functype[0]
$36 = 31
(gdb) p interaction_function[31].longname
$37 = 0x5fa3ba "LJ (SR)"

When inspecting the tpr with gmxdump I find that it's really at functype566 that the position restrains start.

g_hbond checks that the read functype is the one we're after and prints an error message if anything is fishy. Sometimes it even segfaults because of this.

Now I don't know if this is how the ilist is supposed to look for position restraints. Is it some special case for position restraints? I can easily avoid this problem in g_hbond by not sifting through top->idef.il[F_POSRES], but perhaps this grompp anomaly causes problem elsewhere.

Erik Marklund

History

#1 Updated by Erik Marklund over 9 years ago

Now that I look a little closer, it might be that read_tpx_top() is really to blame, because the tpr-file seem correct.

#2 Updated by Erik Marklund over 9 years ago

idef.h got improved documentation and gmx_hbond.c is pathced. Closing bug.

Also available in: Atom PDF