Multicore CPU energy requirement and load balancing

10

4

I am interested in load balancing for multicore CPU systems. If you use 1 CPU with multiple cores, is it more energy efficient to balance the load on several cores, or try to fill up single cores and leave others idle.
The basic assumption is that the amount of work being done in both cases is exactly the same, in the same time. So, is it more efficient to use 4 cores in the same CPU with 25% load each or 1 core with 100% load.
I would assume 1 core with 100% load should be more efficient, but as I might be wrong, I was looking for serious answers about this problem (no guesses).

private_meta

Posted 2010-08-03T11:04:42.393

Reputation: 2 204

+1 Really interesting question! Here are some links http://www.tomshardware.com/reviews/truth-pc-power-consumption,1707.html http://www.tomshardware.com/reviews/intel-cpu-power-consumption,1750.html however they don't really address your question. I have C2D T8100 and one of these days I'm going to do some testing to see which type of load makes more heat.

– AndrejaKo – 2010-08-03T13:18:28.970

4 cores at 25% is definitely going to spread the heat out better than 1 core at 100%. – Brian Knoblauch – 2010-08-03T13:41:43.283

If the amount of work is constant across the use-cases, piling up all the load on the same core is going to make it perform lower -- effectively taking more time and thrashing. You might loose the instantaneous energy savings when the same work requires longer time to complete. (+1, thought provoking question) – nik – 2010-08-03T14:01:09.183

@Brian agreed that using more cores spreads the heat out, but does it generate the same amount of heat in total? – Kevin Panko – 2010-08-03T14:11:01.503

AMD has announced CPUs that will be able to power down unused cores, allowin to run the active cores at higher clock speed – b0fh – 2010-08-03T21:27:32.123

Even if there is some power saving utility, I think you can't turn off the unused cores completely. So, if you still have some power consumption for idle cores, it somehow would seem logical to assume that 4 cores at 25% power consumption would be more efficient than 1 core at 100% and 3 at 1%, but I'm unsure if 25% load on CPU cores translates to 25% power usage. – private_meta – 2010-08-04T23:11:17.193

I am a bit confused regarding the heat. Theoretically, wouldn't a CPU basically run at the same temperature regardless of the number of cores doing th work? Also, what are the real advantages here? Are we talking savings at the consumer level, or only at a level where savings can scale up such as in a data center. – Jonathan – 2010-08-05T16:35:26.440

In terms of heat, a CPU dissipates almost all of its energy as heat. (Also, heat and temperature are different things, but that's a different discussion). Basically, the more power a CPU uses, the more heat it generates and the higher its temperature. New, more efficient processors use less energy and therefore produce less heat because they can partially depower unused cores. – David Markle – 2010-08-07T15:29:18.537

Answers

6

IMO this question is simply unanswerable in the general case.

On my desk I have one of these new-fangled Core i7-980x 6-core TurboBoost enabled CPUs. If you load up a single core on this machine, it will boost the clock speed of that core, thereby increasing the power consumption of the CPU, so that will make for a huge difference. This CPU as well as other, more modern CPUs can partially de-power inactive cores, increasing the power savings. That's not as true on older CPU models.

Keep in mind that the work that you have to do with one core will necessarily be different than the work you do with multiple cores. If it's the case that you can spread the load out onto multiple cores, you'll find that a lot of extra time will be spent on the single core performing expensive context switches, and your performance will suffer.

Anyway, the problem has too many variables to really answer. One could go on and on about the different types of loads, and anyone who tries to benchmark to get an answer will end up (probably inadvertently) making apples-to-oranges comparisons which don't apply in other use cases.

Oh, and one more thing. Most people will probably quote efficiency in terms of power. You don't want to fall into that trap. Since the time to process the loads will necessarily be different depending on how the loads are balanced, you must integrate the result over time to find the net amount of energy used to complete the jobs in order to arrive at a credible result.

David Markle

Posted 2010-08-03T11:04:42.393

Reputation: 454

LOL How could you tell? Hokie Engineering, baby! – David Markle – 2010-08-07T15:14:47.653

Takes one to know one. Go Mizzou – hotei – 2010-08-07T15:16:12.363

Oh wait. I was wrong. There is one man who could run some benchmarks and give us an answer in the general case: http://gizmodo.com/5598885/a-humble-russian-man-presents-his-cpu-collection

– David Markle – 2010-08-07T15:36:40.450

4

I did some tests today using this computer (Intel C2D T8100) and using optimized SETI@Home applications from lunatics installer 0.36. I used M$ Joulmeter to calculate power consumption. I measured consumption tree times. First, I let BOINC take 100% cores and 100% CPU time and let it run for one hour. Processor was consuming 20W and CPU time graphs from task manager were flat at 100%. Average power consumption of my computer was 45.05W and rising and at the moment I stopped test power consumption was 46.18W.

In second test, I set BOINC to take 50% of available cores and 100% of CPU time and let it run for one hour. CPU power consumption varied between 12W and 13W. Average consumption was 42.72W and rising. At the moment I stopped the test, consumption was 44W. In order to make CPU time graph for targeted core be flatline, I set affinity of program to one core and priority to high. The graph for other core showed somewhat higher than normal CPU time use.

For the third test I set BOINC to use 100% of available cores and 50% of CPU time. Power consumption varied in large jumps between 5W and 17W. Average power consumption after one hour of testing was 39.96W and falling. CPU time graphs looled like /\/\/\/\/\/\/\/\/\/\/\/\/\. Spikes were expected because of the size of time units used by BOINC.

So I believe that it is more efficient to use two cores running at half load than to run one core at full load.

And yes, I know that for a proper study much more samples are needed, but at the time I don't have enough computers or time to do proper statistics.

AndrejaKo

Posted 2010-08-03T11:04:42.393

Reputation: 16 459

1Now it would be nice to find an equivalent to the Joulemeter for other operating systems, then I could test some of the equipment I got... – private_meta – 2010-08-07T19:03:20.470

Here's something for GNU/Linux laptops http://www.thinkwiki.org/wiki/How_to_measure_power_consumption

– AndrejaKo – 2010-08-07T20:13:12.330

Here's another interesting link:www.lesswatts.org/ and another one http://www.susegeek.com/general/powertop-free-opensource-linux-tool-to-measure-power-usage/ and another one http://publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/index.jsp?topic=/liaai/energymgmt/liaaienergymgmt.htm Apparently people don't believe ACPI readings and are convinced that external meters are necessary, so few of those links discuss how to use external meters. I'm not 1337 enough with other operating systems to be able to provide any help.

– AndrejaKo – 2010-08-07T20:29:00.910

Thanks. The problem with external meters is that they measure all power consumption, not only processing power. While whole power consumption would be important too (e.g. algorithms extensively use hard drives). If ACPI readings don't seem to be trustable, You'd have to use external readings for Windows Computers as well to be able to compare them :-/ – private_meta – 2010-08-08T20:13:07.507

But still ACPI readings are better than no readings, right? Also, using tests which impact CPU the most, we can establish base power consumption and see how much it increases with load. This way we can know that most of the consumption change was from CPU load. I might do some more testing later with a voltmeter and amperemeter. It'd be really interesting to see how ACPI measurements and real instrument measurements compare. Too bad such comparison cannot be generalized. – AndrejaKo – 2010-08-08T21:38:17.140

0

The answer to your question is twofold: If you are running highly vectorizable, parallel code, then balancing the load over multiple cores is always more efficient. The cores will run at lower loads releasing less heat than a single core that is pushed to it's limit. On the other hand, if your code is not parallelizable, then running it on multiple cores is less efficient because of the number of cache misses that will occur due to dependencies across the code. This might still generate less heat, but it will definitely take longer to complete your task compared to running it on a single core.

emish

Posted 2010-08-03T11:04:42.393

Reputation: 126

1But if you have non-parallelizable code, how are you going to run in on more than one core? – AndrejaKo – 2010-08-06T15:56:51.293

In your opinion, 4 cores pused to 25% together generate less heat (and produces more energy loss) than 1 core pushed to 100%. – private_meta – 2010-08-07T02:30:47.510

@AndrejaKo If there are multiple processes or threads, it's easy to spread them out across cores. – emish – 2010-08-07T04:57:56.970

0

Your question as asked has too many unknowns. Are you asking about time efficiency or energy efficiency? Non parallel code or parallel code? Single job or average desktop multi-tasking? If you've got an energy bill over $1000 / month for your computers then it MIGHT be worth a worry or two. Otherwise you can't save enough to make the problem worth solving. Fun to talk about - but if you've got a serious problem the best answer is : try some different things and see what works.

hotei

Posted 2010-08-03T11:04:42.393

Reputation: 3 645