Project

General

Profile

Bug #3391

Integer overflow in dispersion correction

Added by Paul Bauer 6 months ago. Updated 6 months ago.

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

Description

from the developer mailing list:

I noticed the following mdrun (version 2020) warning in a run with dispersion corrections switched on (dispcorr = EnerPres):

WARNING: There are no atom pairs for dispersion correction

accordingly, the Disper. corr. contribution is 0.00000e+00 in that simulation.

In contrast, the same tpr does not trigger this warning with gromacs2018 or 2019, and the expected Disper. corr. contribution is found in the output (for this particular run -8.67338e+03 at step 0).

A comparison between the 2019 and 2020 versions suggests this to be connected with the variables npair, npair_ij, iCount and jCount in dispersioncorrection.cpp having switched from int64_t in 2019 to int in version 2020. Indeed, monitoring these variables showed these to turn negative, suggesting an int overflow. Switching these variables back to int64_t as in the attached dispersioncorrection.cpp gives back the expected, non-zero dispersion correction.

dispersioncorrection.cpp (25.3 KB) dispersioncorrection.cpp Paul Bauer, 02/21/2020 03:46 PM

Associated revisions

Revision a8d04141 (diff)
Added by Paul Bauer 6 months ago

Avoid integer overflow in dispersion correction

Index could become out of range and turn negative.

Fixes #3391

Change-Id: I91a8ea0ab01370fb972c02994e2b996284e1d06a

History

#1 Updated by Paul Bauer 6 months ago

  • Status changed from New to Fix uploaded

#2 Updated by Paul Bauer 6 months ago

  • Status changed from Fix uploaded to Resolved

#3 Updated by Paul Bauer 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF