In its Energy-Efficient Software Guidelines Intel suggests that programs are designed multithreaded for better energy efficiency.
I don’t get it. Suppose I have a quad core processor that can switch off unused cores. Suppose my code is perfectly parallelizeable (synchronization overhead is negligible).
If I use only one core I burn one core for one hour, if I use four cores I burn four cores for 15 minutes – the same amount of core-hours either way. Where’s the saving?
I suspect it has to do with a non-linear relation between CPU utilization and power consumption. So if you can spread 100% CPU utilization over 4 CPUs each will have 25% utilization – and say 12% consumption.
This is especially true when dynamic CPU scaling is used according to Wikipedia the power drain of a CPU is
P = C(V^2)F. When a CPU is running faster it requires higher voltages – and that ‘to the power of 2’ becomes crucial. Furthermore the voltage will be a function of F (which means F can be solved for V) giving something likeP = C(F^2)F. Thus by spreading the load over 4 CPUs (running at 100% capacity at that frequency) you can mitigate the cost for the same work.We can make F a function of L (load) at 100% of one core (as it would be in your OS), so:
Now that we can relate load (L) to the power consumption we can see the characteristics of the power consumption given everything on one core:
Or spread over 4 cores:
Notice the factors in front of the L^2 and L^3.