test: Fix OpenMP clauses for the tolerance-test
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>
Fri, 7 Mar 2014 06:23:10 +0000 (08:23 +0200)
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>
Wed, 2 Apr 2014 09:46:09 +0000 (12:46 +0300)
commit56622140e3a8175c8ccc82c9717adf8372043364
tree67fe2c81bbc31c638276f4dd0798fead5e00fc30
parent840912b31159aa8ac7be4ea0cee8bdef95a539a4
test: Fix OpenMP clauses for the tolerance-test

Compiling with the Intel Compiler reveals a problem:

tolerance-test.c(350): error: index variable "i" of for statement following an OpenMP for pragma must be private
  #       pragma omp parallel for default(none) shared(i) private (result)
  ^

In addition to this, the 'result' variable also should not be private
(otherwise its value does not survive after the end of the loop). It
needs to be either shared or use the reduction clause to describe how
the results from multiple threads are combined together. Reduction
seems to be more appropriate here.
test/tolerance-test.c