OpenMP: efficiency in reduction in large array

omp_get_wtime() measures the elapse time, that is it simply reading a clock and returning the value. cpu_time() measures the time that each core spents executing a thread, and sums all of them. The cpu_time() of an OpenMP code that scales perfectly should be the same as the cpu_time() of the serial code, while the omp_get_wtime() should be inversely proportional to the number of threads.

Regarding your code, before thinking about parallelizing it, you should make sure that the serial version really does what it is supposed to do. It’s not that clear at the moment.