Bug #972

g_hbond crashes with openmp and -ac

Added by David van der Spoel over 8 years ago. Updated over 8 years ago.

analysis tools
Target version:
Affected version - extra info:
4 and higher.
Affected version:


g_hbond crashes when run in parallel using openmp.

Running g_hbond -ac -n with the attached files will trigger the problem.

I have cleaned up the code in order to remove uninitialized memory, however so far without success. The fact that the crashes are in different places in the code if you run it multiple times, indicate that memory initialization might be the cause of this.

ghbbug.tgz (1.72 MB) ghbbug.tgz David van der Spoel, 07/20/2012 11:31 AM


#1 Updated by Erik Marklund over 8 years ago

I'm semi-off the internet at the moment and have little time testing or bugfixing this in the immediate future. I assume it crashes while searching for hbonds, and not in the acf calculations, no? As you know, there have been a few commits to patch gmx_hbond.c recently, including one for release-4-6-patches with an OpenMP cleanup that also introduced a critical section around the parts where hbonds/contacts are stored in the frame loop. I see that you have filed this issue for 4.5.6, but the aforementioned commit may contain the solution. I suggest testing with a smoking hot release-4-6-patches.

#2 Updated by David van der Spoel over 8 years ago

It does not crash in 4.6. I will try to test the results as well, and if it s fine will close the bug. We should disable threads in 4.5.6 then.

#3 Updated by Erik Marklund over 8 years ago

Aren't threads only turned on when building gromacs with rather obscure preprocessor macros defined in 4.5? I guess we should prevent that too.

#4 Updated by David van der Spoel over 8 years ago

  • Status changed from New to Closed

Threads are turned off unless one goes into the code and uncomments a preprocessor #define.

Also available in: Atom PDF