Hi all, It's been a while, but I've got a strange technical question for you gurus here. I'm running a monte carlo code on a machine with hyperthreading. We've noticed that, as we approach the number of physical cores, the speed increase we get from adding more cores to the problem, slows down. So, for example we get a speed increase of 1.8x by using 2 cores, 2.6x by using 3, but when we use 4 (on a quad core machine) the speed increase may only be 2.8x. If we turn off hyperthreading, the speed increase we get by using 4 cores becomes 3.5x. Now, the computer needs to remain usable, so we have to keep hyperthreading on. So, I'm wondering, is there any way I can force the code to use only the physical cores? Thanks Andy
I suppose this is more of a code optimisation question than a hardware question. However since this is posted in hardware perhaps the easiest solution is to upgrade to a hex core processor and limit your monte carlo algorithm to 4 cores.
8 threads will run faster on a 4-core CPU with HT enabled than with HT disabled, that's what HT is for. With HT enabled it seems that the load between the CPU intensive program and other programs is more evenly distributed. You could try playing with affinities and priorities in Task Manager. You could also try changing the "processor scheduling" setting in advanced computer properties. Failing that, a CPU with more cores seems to be the most logical approach.
Hmmm, that's what I was thinking of. Unfortunately, the budget is a little light at the moment, so I guess we'll just have to play around with the hyperthreading and CPU affinity... Thanks for the replies guys. Andy
Some applications (sql server, prime example) have their own internal thread pooling that do not respond well to HT, that may be part of why your stuff is not scaling the way you'd like. I think part of that is that the responses back per thread cannot be entirely asynchronous, the order of return is relevant to the overall algorithm. Have you considered a GPGPU solution instead?
Hyper threading has overheads that are small but noticeable in this sort of testing. If your program is coded for hyperthreading you would see more benefits.
This depends on if all physical cores are 100% utilised or not. If they are maxed out there is a good chance that performance will actually be worse as a result of the over head of using hyper threading.
Actually, the point of hyperthreading is to utilize CPU resources better in full load scenarios where there are more threads than physical cores.
Try setting affinity to odd numbered cores, I think there is a program that can tell other programs which cores to use when you start it up.