Project

General

Profile

Bug #1312

g_enemat broken

Added by Justin Lemkul over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Low
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

I discovered a weird problem when trying to troubleshoot g_enemat. As has been reported to the gmx-users list several times now, it seems that g_enemat either cannot find the correct energy terms, assigning (null) instead of, e.g. LJ-SR or Coul-SR, or otherwise failing to read in groups that actually do exist. When working with VERSION 4.6.3-dev-20130628-9cd3bcc g_enemat (I also reproduced the same failure with 4.6):

g_enemat -f ener.edr -groups groups.dat -emat test.xpm

I get the following output:

Opened ener.edr as single precision energy file
Will read groupnames from inputfile
Read 2 groups
group 0WARNING! could not find group (null):Protein-Protein (0,0)in energy file
WARNING! could not find group (null):Protein-non-Protein (0,1)in energy file
group 1WARNING! could not find group (null):non-Protein-non-Protein (1,1)in energy file

Will select half-matrix of energies with 6 elements
Last energy frame read 0 time    0.000            
Will build energy half-matrix of 2 groups, 6 elements, over 1 frames
Segmentation fault: 11

I decided to compile in debug mode (CMAKE_BUILD_TYPE=DEBUG) and run through gdb. Just to confirm I wasn't overlooking something, I re-ran my previous g_enemat command using the new g_enemat binary, which magically worked:

Opened ener.edr as single precision energy file
Will read groupnames from inputfile
Read 2 groups
group 1
Will select half-matrix of energies with 6 elements
Last energy frame read 0 time    0.000            
Will build energy half-matrix of 2 groups, 6 elements, over 1 frames
Matrix of Coul-SR energy ranges from -433997.875000 to -2762.166992
Matrix of LJ-SR energy ranges from -798.468628 to 41228.601562
Matrix of total energy ranges from -392769.281250 to -3560.635742
100%

So compiling with -DCMAKE_BUILD_TYPE=RELEASE produces a nonfunctional g_enemat, but -DCMAKE_BUILD_TYPE=DEBUG works.

Attached are the ener.edr and groups.dat files I have been using to test.

ener.edr (1.51 KB) ener.edr Justin Lemkul, 07/24/2013 03:06 PM
groups.dat (22 Bytes) groups.dat Justin Lemkul, 07/24/2013 03:06 PM

Associated revisions

Revision 24f960d3 (diff)
Added by David van der Spoel over 4 years ago

Fixes #1312 uninitialized error in g_enemat.

Change-Id: Ia0ac6d095dd560f08576aad1b435c92b6de52b3b

History

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

  • Status changed from New to Fix uploaded

Fix uploaded in git fetch https://gerrit.gromacs.org/gromacs refs/changes/21/2521/1 && git checkout FETCH_HEAD

#2 Updated by Justin Lemkul over 4 years ago

David van der Spoel wrote:

Fix uploaded in git fetch https://gerrit.gromacs.org/gromacs refs/changes/21/2521/1 && git checkout FETCH_HEAD

Thanks David, it works now.

#3 Updated by Mark Abraham over 4 years ago

  • Status changed from Fix uploaded to Resolved

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

  • Status changed from Resolved to Closed

Fix has been merged.

Also available in: Atom PDF