Verify reduction result to 8 decimal places

This commit is contained in:
Tom Deakin 2016-10-24 16:22:35 +01:00
parent f32cf3bad3
commit 644ebc40ef

View File

@ -273,9 +273,12 @@ void check_solution(const unsigned int ntimes, std::vector<T>& a, std::vector<T>
std::cerr
<< "Validation failed on c[]. Average error " << errC
<< std::endl;
if (errSum > epsi)
// Check sum to 8 decimal places
if (errSum > 1.0E-8)
std::cerr
<< "Validation failed on sum. Error " << errSum
<< std::endl << std::setprecision(15)
<< "Sum was " << sum << " but should be " << goldSum
<< std::endl;
}