1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPU Can I only use physical cores?

Discussion in 'Hardware' started by Shielder, 11 Sep 2012.

  1. Shielder

    Shielder Live long & prosper!

    Joined:
    26 Jul 2007
    Posts:
    596
    Likes Received:
    0
    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
     
  2. theshadow2001

    theshadow2001 [DELETE] means [DELETE]

    Joined:
    3 May 2012
    Posts:
    5,162
    Likes Received:
    141
    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.
     
  3. mm vr

    mm vr The cheesecake is a lie

    Joined:
    18 Nov 2007
    Posts:
    2,968
    Likes Received:
    84
    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.
     
  4. Shielder

    Shielder Live long & prosper!

    Joined:
    26 Jul 2007
    Posts:
    596
    Likes Received:
    0
    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
     
  5. Landy_Ed

    Landy_Ed Combat Novice

    Joined:
    6 May 2009
    Posts:
    1,428
    Likes Received:
    39
    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?
     
  6. rollo

    rollo Well-Known Member

    Joined:
    16 May 2008
    Posts:
    7,700
    Likes Received:
    99
    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.
     
  7. tehBoris

    tehBoris New Member

    Joined:
    30 Jan 2011
    Posts:
    616
    Likes Received:
    25
    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.
     
  8. mm vr

    mm vr The cheesecake is a lie

    Joined:
    18 Nov 2007
    Posts:
    2,968
    Likes Received:
    84
    Actually, the point of hyperthreading is to utilize CPU resources better in full load scenarios where there are more threads than physical cores.
     
  9. Deders

    Deders New Member

    Joined:
    14 Nov 2010
    Posts:
    4,048
    Likes Received:
    106
    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.
     

Share This Page