Using
#pragma omp parallel for reduction(+:varName)
instead of using
may be beneficial from a performance point of view. It's unclear what happens to varName if the for loop is executed multiple times (e.g. for different chunks) - will it be reinitialized to 0 each time?