BugFix: Zeroing the padded area of coordinates vectors in LeapFrog tests
authorArtem Zhmurov <zhmurov@gmail.com>
Tue, 13 Aug 2019 14:55:57 +0000 (16:55 +0200)
committerErik Lindahl <erik.lindahl@gmail.com>
Wed, 14 Aug 2019 08:15:25 +0000 (10:15 +0200)
The reserveWithPadding does not put zeros to the vectors. In some cases
this lead to some residue data in padded area which caused floating
point exceptions when SIMD kernel was used (in ~1 out of 200 cases).

Change-Id: I7f9898ffc4b933c054d1ca4746d9b8de8caed3fb

src/gromacs/mdlib/tests/leapfrogtestrunners.cpp

index 6fcdff5f2bd6f6c6d43b63ac9cb45862c6559d54..5da88994ca48cb3ca369c7adfed1941ec9acf188 100644 (file)
@@ -73,8 +73,8 @@ namespace test
 void integrateLeapFrogSimple(LeapFrogTestData *testData,
                              int               numSteps)
 {
-    testData->state_.x.reserveWithPadding(testData->numAtoms_);
-    testData->state_.v.reserveWithPadding(testData->numAtoms_);
+    testData->state_.x.resizeWithPadding(testData->numAtoms_);
+    testData->state_.v.resizeWithPadding(testData->numAtoms_);
     for (int i = 0; i < testData->numAtoms_; i++)
     {
         testData->state_.x[i] = testData->x_[i];
@@ -94,7 +94,7 @@ void integrateLeapFrogSimple(LeapFrogTestData *testData,
                       &testData->kineticEnergyData_,
                       testData->prVScalingMatrix_,
                       testData->update_.get(),
-                      0,
+                      etrtNONE,
                       nullptr,
                       nullptr);
         finish_update(&testData->inputRecord_,