Jump to content


Photo

Question On Hyperthreading


  • Please log in to reply
7 replies to this topic

#1 Ishtvan

Ishtvan

    Programmer

  • Development Role
  • PipPipPipPipPip
  • 14860 posts

Posted 11 March 2005 - 12:49 AM

So at work I'm using a commercial simulation program that apparently doesn't incorporate hyperthreading. I'll run a dedicated simulation and only see 50% CPU usage. So I'm wondering: Would turnign hyperthreading off in the BIOS help this program utilize more of the CPU and hopefully run faster?

Please lemme know if you have any advice. It's kind've nice to be able to do stuff while it's running, but when Im running something for 8 hours straight and not at the computer I want it to use as much of the CPU as possible.

#2 Ishtvan

Ishtvan

    Programmer

  • Development Role
  • PipPipPipPipPip
  • 14860 posts

Posted 14 March 2005 - 12:51 AM

No takers?

#3 sparhawk

sparhawk

    Repository Manager

  • Active Developer
  • PipPipPipPipPip
  • 21776 posts

Posted 14 March 2005 - 04:16 AM

Just a guess, but why should turning it off, make it faster?
Gerhard

#4 Domarius

Domarius

    Mod hero

  • Member
  • PipPipPipPipPip
  • 7659 posts

Posted 14 March 2005 - 08:12 AM

There's probably a good reason why you didn't test it yourself without hyperthreading enabled, I'm just curious why.

#5 Ishtvan

Ishtvan

    Programmer

  • Development Role
  • PipPipPipPipPip
  • 14860 posts

Posted 14 March 2005 - 03:46 PM

@Dom: Oh, that good reason would be that I'm lazy. I was just hoping some random person on here would have an intimate knowledge of how hyperthreading works. :) Also, this is being run on my home computer and I don't want to screw anything up by accident.

@Spar: I thought maybe the reason turning it off would make it faster would be that the processor would start operating in "normal" mode, rather than reserving half of it for fake dual-processor stuff, or however it works.

#6 sparhawk

sparhawk

    Repository Manager

  • Active Developer
  • PipPipPipPipPip
  • 21776 posts

Posted 14 March 2005 - 04:31 PM

As I understand it, hyperthreading is like having two CPUs on one CPU. The operating system also sees such a CPU as if there were two present. So turning it off means that you essentially half the computing power because the second core will not be used. AFAIK there is no such thing as reserving computing power for the second half inside the CPU, but I'm not a hardware expert. Normally the OS should distribute the load on both CPUs. I don't really know the internals of Windows that good, but I think it might be that it distributes the load only over processes and not over threads. In that case, if your application is not aware of multiple CPUs it will only run on one. If Windows distributes the load on threads as well then your application might still not take advantage of it, if it does it's computing only as a single thread (like most applications work). So the only way that I can see to make your app aware of it is to make it at least threadable.
To verify this, you could write a simple testprogramm with an endless loop and then look how much CPU power it consumes. I would assume that it also would go only for 50% because it will only use one CPU. If you run this test twice it should take 100% now.

You can then extend this test and make it multithreaded and run the infinte loop in two thread. if the application used before 50% and now 100%, then Windows distributes over threads. In this case you can only look for another application that can split up it's calculations into multiple patches. Some renderer do this, but the application has to be written to support this of course.
Gerhard

#7 Ishtvan

Ishtvan

    Programmer

  • Development Role
  • PipPipPipPipPip
  • 14860 posts

Posted 16 March 2005 - 12:08 AM

Do HT CPU's really have two cores though? I asked a coworker about that, and he said that it was most likely "faking" 2 cores, so some combination of the chipset BIOS and the OS software makes it act like it has 2 cores, but it does not actually. Maybe turning HT off in the bios will stop this faking operation and let a non-HT program use more of the whole processor instead of fake-dividing the processor in 2?

Unfortunately I can't change this app at all; it's commercial simulation software that's not open sourced. It does support "cluster" processing. I wonder if it could be hacked to view the fake "2nd core" on an HT CPU as another machine in a cluster... I dunno.

Btw yeah I did put it under full load in one copy and it was 50% of the CPU. I haven't tried running two copies of the app yet, but I imagine it will take up 100% as you said.

So I guess I could at least run 2 different simulations at the same time to save a little time.

You'd think these bastards would support modern CPU technology at the prices they charge for their software <_<

Hmm... maybe I could use the supported "clustered computing" to trick it into running 2 threads and going back and forth between for calculations. IE, cluster #1 is running on localhost, cluster #2 is a 2nd copy of the program also running on localhost (or some network mask that redirects it back to me) ... maybe.

Edited by Ishtvan, 16 March 2005 - 12:15 AM.


#8 sparhawk

sparhawk

    Repository Manager

  • Active Developer
  • PipPipPipPipPip
  • 21776 posts

Posted 16 March 2005 - 04:13 AM

Do HT CPU's really have two cores though?  I asked a coworker about that, and he said that it was most likely "faking" 2 cores, so some combination of the chipset BIOS and the OS software makes it act like it has 2 cores, but it does not actually.


That's right. I was talking from the operating system point of view where it is treated as two actual CPUs.

Maybe turning HT off in the bios will stop this faking operation and let a non-HT program use more of the whole processor instead of fake-dividing the processor in 2?


Don't know if that works, you can only test it. :)

Unfortunately I can't change this app at all; it's commercial simulation software that's not open sourced.  It does support "cluster" processing.  I wonder if it could be hacked to view the fake "2nd core" on an HT CPU as another machine in a cluster... I dunno.


Maybe you can run it in VMware then? Both machines would be treated as seperate processes and this might help speed up the overall performance in this case.

Btw yeah I did put it under full load in one copy and it was 50% of the CPU.  I haven't tried running two copies of the app yet, but I imagine it will take up 100% as you said.


Yeah. So it is as I thought that it acts like two CPUs from the application point of view. Don't know though how far this actually goes.

So I guess I could at least run 2 different simulations at the same time to save a little time.


If that is possible. Can't say as I don't know what your expectations are. If you can split the jobs up in seperate chunks, this would be a solution.

You'd think these bastards would support modern CPU technology at the prices they charge  for their software <_<


LOL.
Gerhard




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users