Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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).

share|improve this question
    
+1 Really interesting question! Here are some links tomshardware.com/reviews/truth-pc-power-consumption,1707.html 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 Aug 3 '10 at 13:18
    
4 cores at 25% is definitely going to spread the heat out better than 1 core at 100%. –  Brian Knoblauch Aug 3 '10 at 13:41
    
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 Aug 3 '10 at 14:01
    
@Brian agreed that using more cores spreads the heat out, but does it generate the same amount of heat in total? –  Kevin Panko Aug 3 '10 at 14:11
    
AMD has announced CPUs that will be able to power down unused cores, allowin to run the active cores at higher clock speed –  b0fh Aug 3 '10 at 21:27
show 3 more comments

4 Answers

up vote 5 down vote accepted

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.

share|improve this answer
1  
+1 Spoken like an engineer. –  hotei Aug 7 '10 at 15:09
    
LOL How could you tell? Hokie Engineering, baby! –  David Markle Aug 7 '10 at 15:14
    
Takes one to know one. Go Mizzou –  hotei Aug 7 '10 at 15:16
    
Oh wait. I was wrong. There is one man who could run some benchmarks and give us an answer in the general case: gizmodo.com/5598885/… –  David Markle Aug 7 '10 at 15:36
add comment

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.

share|improve this answer
1  
Now 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 Aug 7 '10 at 19:03
    
Here's something for GNU/Linux laptops thinkwiki.org/wiki/How_to_measure_power_consumption –  AndrejaKo Aug 7 '10 at 20:13
    
Here's another interesting link:www.lesswatts.org/ and another one susegeek.com/general/… and another one publib.boulder.ibm.com/infocenter/lnxinfo/v3r0m0/… 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 Aug 7 '10 at 20:29
    
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 Aug 8 '10 at 20:13
    
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 Aug 8 '10 at 21:38
add comment

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.

share|improve this answer
1  
But if you have non-parallelizable code, how are you going to run in on more than one core? –  AndrejaKo Aug 6 '10 at 15:56
    
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 Aug 7 '10 at 2:30
    
@AndrejaKo If there are multiple processes or threads, it's easy to spread them out across cores. –  emish Aug 7 '10 at 4:57
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.