Project

General

Profile

Bug #1163

Better support for sprintf-style error messages

Added by Justin Lemkul almost 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
mdrun
Target version:
Affected version - extra info:
4.6
Affected version:
Difficulty:
uncategorized
Close

Description

I've seen this a few times on this mailing list now, so I figured I would mention it. When systems blow up, they no longer correctly report the violating distances. The output message comes from src/gmxlib/nonbonded/nonbonded.c, but rather than printing actual floating-point numbers, the user is shown '3f' instead. The code seems to be constructed correctly, and I can't find any relevant change that was made to affect it, unless I'm just staring at something obvious and missing it.

Example:

WARNING: Listed nonbonded interaction between particles 794 and 797
at distance 3f which is larger than the table limit 3f nm.

Associated revisions

Revision 8f16a532 (diff)
Added by Roland Schulz about 6 years ago

Remove reimplimentation of two functions

- parse_printf_args was identical to vsprintf (C89)
- str_to_int64_t was identical to strtoll (C99) and
MSVC provides an replacement (_strtoi64)

Fixes #1163

Change-Id: I62fedc4193b408584d1c6978949202f11a9f81aa

History

#1 Updated by Roland Schulz almost 7 years ago

  • Assignee changed from Berk Hess to Erik Lindahl

This is introduced by Erik in f40969c24581f. He replaced fprintf with gmx_warning which doesn't support %.3f. Any reason we can't replace parse_printf_args by vsnprintf? It would fix this and also make sure we don't get similar problem again with gmx_fatal/gmx_warning.

#2 Updated by Mark Abraham almost 7 years ago

Roland Schulz wrote:

This is introduced by Erik in f40969c24581f. He replaced fprintf with gmx_warning which doesn't support %.3f. Any reason we can't replace parse_printf_args by vsnprintf? It would fix this and also make sure we don't get similar problem again with gmx_fatal/gmx_warning.

IIRC, not all C libraries support vnsnprintf and friends. I'm pretty sure those for the compiler for BlueGene/L did not. Not sure about /Q.

#3 Updated by Mark Abraham over 6 years ago

  • Target version deleted (4.6.2)
  • Affected version set to 4.6

#4 Updated by Mark Abraham about 6 years ago

vsprintf compiles OK on BG/Q

#5 Updated by Mark Abraham about 6 years ago

  • Subject changed from Output bug when blowing up to Better support for sprintf-style error messages
  • Assignee changed from Erik Lindahl to Roland Schulz
  • Target version set to 5.0

#6 Updated by Roland Schulz about 6 years ago

  • Status changed from New to Closed

Patch has been committed: 8f16a532d910e75802b855843d1c54d83e247a68

Also available in: Atom PDF