Search code examples
concurrencyparallel-processingopenmp

How does OpenMP actually reduce clock cycles?


It might be a silly question but, with OpenMP you can achieve to distribute the number of operations between all the cores your CPU has. Of course, it is going to be faster in 99% times because you went from a single core doing N operations to K cores doing the same amount operations at the same time.

Despite of this, the total amount of clock cycles should be the same, right? Because the number of operations is the same. Or I am wrong?


Solution

  • I think the answer depends on how you define the total amount of clock cycles. If you define it as the sum of all the clock cycles from the different cores then you are correct and there will not be fewer clock cycles. But if you define it as the amount of clock cycles for the "main" core between initiating and completing the distributed operations then it is hopefully fewer.