mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware

Reply
 
Thread Tools
Old 2005-11-26, 04:07   #1
drew
 
drew's Avatar
 
Jun 2005

1011111102 Posts
Default Hyperthreading and CPU utilization.

I'm sure this has been discussed before, but I don't know where.

I just discovered that my instance of Prime95 is operating at only 50% utilization. Is there a way to change this? It's a hyperthreaded CPU, so I don't know if it's effectively the same as a dual-proc, or what?

Thanks,
Drew
drew is offline   Reply With Quote
Old 2005-11-26, 05:42   #2
scanrik
 

31·107 Posts
Default Run two copies

There's no way that I can find to goose Windows to give you the whole CPU. That's because of Intel's shadow registers (for hyperthreading).

You can run a second copy of Prime95. But ...

I just ran a little test consisting of generating 10^8 random dfloats.
The test program alone takes 13 seconds.
With one copy of Prime95 running, the test program takes 19 seconds.
With two copies of Prime95 running, the test program takes 19 seconds.

So, it's likely that two copies of Prime95 crank along about 1.5X one copy, even though you have "fully" utilized the CPU. So much for hyperthreading.

- rll
  Reply With Quote
Old 2005-11-26, 07:57   #3
drew
 
drew's Avatar
 
Jun 2005

2×191 Posts
Default

Quote:
Originally Posted by scanrik
There's no way that I can find to goose Windows to give you the whole CPU. That's because of Intel's shadow registers (for hyperthreading).

You can run a second copy of Prime95. But ...

I just ran a little test consisting of generating 10^8 random dfloats.
The test program alone takes 13 seconds.
With one copy of Prime95 running, the test program takes 19 seconds.
With two copies of Prime95 running, the test program takes 19 seconds.

So, it's likely that two copies of Prime95 crank along about 1.5X one copy, even though you have "fully" utilized the CPU. So much for hyperthreading.

- rll
Hmmm...I just turned HT off, and the iteration times dropped from .066 to .064 seconds. Hardly a difference, but I had never seen it go as low as .064 before.

Drew
drew is offline   Reply With Quote
Old 2005-11-26, 17:35   #4
moo
 
moo's Avatar
 
Jul 2004
Nowhere

32916 Posts
Default

HT is not useful in prime95 because the program uses only 1 cpu / logical unit. Its best to test weather your getting more work done running 2 copies of prime95 if you arnt then you should just turn off ht in the bios.
moo is offline   Reply With Quote
Old 2005-11-26, 21:07   #5
drew
 
drew's Avatar
 
Jun 2005

2×191 Posts
Default

Quote:
Originally Posted by moo
HT is not useful in prime95 because the program uses only 1 cpu / logical unit. Its best to test weather your getting more work done running 2 copies of prime95 if you arnt then you should just turn off ht in the bios.
It appears to run slower while I'm using the PC, though. I'm starting to think it's a wash whether I leave HT on or off.

Drew
drew is offline   Reply With Quote
Old 2005-11-27, 04:01   #6
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

22·3·641 Posts
Default

Quote:
Originally Posted by drew
I'm sure this has been discussed before, but I don't know where.
Usually in the "Information & Answers" or "Software" subforums.

After a quick review of titles and threads, I can't find an earlier instance of this topic in "Hardware", so you're probably the first to post it here. It seems like a reasonable choice to me -- I was surprised not to find an earlier "50% utilization" thread here.

Quote:
I just discovered that my instance of Prime95 is operating at only 50% utilization. Is there a way to change this? It's a hyperthreaded CPU, so I don't know if it's effectively the same as a dual-proc, or what?
Others have responded to you above, so I'll just add a few clarifying (I hope) statements. (Maybe you already know this stuff.)

A hyperthreaded CPU is not effectively the same as a dual-processor CPU. An HT CPU has just 1 real CPU, but pretends that it has another, virtual CPU that can execute a second instruction stream. It has a few extra real components (extra registers) beyond what a non-HT CPU has, but does not duplicate most components.

The HT CPU can rapidly switch back and forth between two instruction streams, using separate components (e.g., ALU for integer arithmetic, FPU for floating-point) to overlap some instructions of the separate streams in the only real CPU.

The HT CPU also fools monitor software into thinking that there are two CPUs, so when the one real CPU is really 100% utilized by a single instruction stream, the monitor is tricked into telling you that your system is only 50% loaded.

But an HT CPU can't fool either Mother Nature or Father Mersenne; an L-L test requires real processor cycles; virtual cycles do it no good. :-)
cheesehead is offline   Reply With Quote
Old 2005-11-30, 15:09   #7
drew
 
drew's Avatar
 
Jun 2005

38210 Posts
Default

Quote:
Originally Posted by drew
Hmmm...I just turned HT off, and the iteration times dropped from .066 to .064 seconds. Hardly a difference, but I had never seen it go as low as .064 before.

Drew
Update. I tried a second instance of Prime95, and now when the computer is otherwise idle, they're running at .119 and .120 seconds per iteration, which totals .0595 seconds per iteration. A clear improvement over one instance at a time.

Drew
drew is offline   Reply With Quote
Old 2005-12-06, 16:24   #8
MS63
 
Oct 2005

22·32 Posts
Default

Some time ago I carried out a few experiments on my 3EGHz P4 Prescott running Prime95 with priority 10 on a 10,000,000 digit candidate and discovered the following:

With HT turned ON and no affinity set, per iteration time of 0.077;
With HT turned ON and affinity set to 0, per iteration time of 0.074;
With HT turned ON and affinity set to 1, per iteration time of 0.075;
(These all show an overall CPU usage of <51%; 50% is used by Prime95, <1% is used by the system, anti-virus, firewall, etc.)

With HT turned OFF the per iteration time INCREASES to (I've forgotten! I know it nearly doubles. I'll check it again and come back shortly and fill this in. What an idiot!)
CPU usage is at 100%, nearly all used by Prime95.

Because of these results I have HT turned ON and Prime95 affinity set to 0.

I don't understand these results:
Why, with HT turned ON, is processor 0 faster than processor 1?
Why, with HT turned OFF, does the per iteration time INCREASE?
MS63 is offline   Reply With Quote
Old 2005-12-06, 18:48   #9
MS63
 
Oct 2005

22·32 Posts
Default

(I thought I'd be able to EDIT my previous post. Never mind.)

What a load of rubbish that was. The actual per iteration time with HT turned OFF was 0.079.

BUT ...

With priority set to 10 it slowed everything else down beyond anything reasonable. For example, it took over two minutes to load a simple performance monitor that usually takes two seconds.

In conclusion, my experience dictates that if you have an HT enabled processor you should turn HT ON.
MS63 is offline   Reply With Quote
Old 2005-12-06, 21:29   #10
drew
 
drew's Avatar
 
Jun 2005

1011111102 Posts
Default

Quote:
Originally Posted by MS63
(I thought I'd be able to EDIT my previous post. Never mind.)

What a load of rubbish that was. The actual per iteration time with HT turned OFF was 0.079.

BUT ...

With priority set to 10 it slowed everything else down beyond anything reasonable. For example, it took over two minutes to load a simple performance monitor that usually takes two seconds.

In conclusion, my experience dictates that if you have an HT enabled processor you should turn HT ON.
From my experience, it's even better to run two instances of Prime95 with distinct affinity values 0 and 1. On my tests, I'm getting .119 and .120 iterations/second, which totals .0597 iterations/second, whereas with one instance I was getting about .064 iterations/second.

I actually had better results when idle with HT off, but it took a much bigger hit when I was using the PC.

Drew
drew is offline   Reply With Quote
Old 2005-12-07, 21:36   #11
MS63
 
Oct 2005

22·32 Posts
Default

From VERY unreliable memory my per iteration time INCREASED when I ran two instances of Prime95, not decreased as you have experienced.

I will experiment with this again after Christmas: I have a 10,000,000 digit prime candidate due to complete LL testing on Christmas day.

Incidentally, if one runs two instances of Prime95, do they each require their own User/Computer ID? I'm guessing they do.

Last fiddled with by MS63 on 2005-12-07 at 21:37
MS63 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperthreading TheMawn Hardware 12 2013-08-15 00:03
Hyperthreading Primeinator Information & Answers 13 2010-05-20 15:15
Hyperthreading Jud McCranie Information & Answers 11 2009-03-05 06:41
Should hyperthreading be used? Electrolyte Hardware 5 2006-11-08 01:29
Hyperthreading dave_0273 Hardware 5 2003-12-12 13:22

All times are UTC. The time now is 11:26.


Fri Jul 16 11:26:44 UTC 2021 up 49 days, 9:14, 1 user, load averages: 1.53, 1.62, 1.58

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.