Reply 320 of 330, by underjack
Tommaso72 wrote on 2020-06-05, 07:01:I have a question about Multicore SuperPi. I ran it on a P4 Northwood 3.06 Ghz cpu and set it to 32 with two threads for the hy […]
I have a question about Multicore SuperPi. I ran it on a P4 Northwood 3.06 Ghz cpu and set it to 32 with two threads for the hyperthreading . It finished at 72 seconds. Then ran it with one thread and got 111 seconds. This seems normal to me., but then I wanted to compare my P4 Prescot 3.2 Ghz. with hyperthreading and got the same as the Northwoods time of 72 seconds with 2 threads. What confuses me is I did it again with one thread and it was finished at 52 seconds? Why would it be faster with one thread? I thought the HT would boost it a bit like it did with the Northwood CPU.
The Prescott system is the newer model with 2 gigs cache, and it currently is running with one RAM stick of 1 gig, and the Northwood had 2 sticks of 512 megs each being dual channel. May be the longer pipeline of the Prescott is not liking the single channel RAM when using 2 threads?
Hope I wrote this clear enough to make sense, I worked all night and I smoked a fatty. Hope someone can shead some light on the subject, thanks in advance.
Tommaso
A hyperthreaded CPU isn't truly multicore. What's going on is you have one set of execution hardware, and two sets of registers and control hardware, so that two threads of execution can share the ALU. The idea when one thread isn't using the one or more of the execution units, the other can.
So your speed up will never be 100%, and in this case, since SuperPi has pretty good utilization, it will be much lesss, since the threads will do a lot of waiting for the other thread to free the ALU resources.
(A CPU is a guy with a calculator, some scratchpads, and a list of instructions. A HT CPU is two guys each with their own instructions and scratchpads, but only one calculator that they have to share.)