Hyperthreading and core affinity on i7?

Grall

Invisible Member
Legend
How are the cores - physical and virtual - numbered in the windows task manager on an i7, does anyone know?

I suspect it's the standard odd/even relationship, but I really have no genuine idea. :)

Also, is there some kind of utility out there that can launch other programs with a set core affinity in a way that you can configure yourself, so that you just launch the utility and your programs start up in an easily repeatable fashion?
 
if you fell like programming...

You could use
SetProcessAffinityMask to set the cpu affinity.
GetSystemInfo to find how many core are there.

If you want a launcher, probably you want to also need to use:
CreateProcess

A
 
I just realized an external launcher wouldn't do any good...

The thing is, I run four instances of the standard Folding@Home single-core CPU client (due to the SMP clients being too quirky and annoying to deal with), and thought it would be real nice if I could bind each client to a single CPU core.

The problem is that it isn't the client that does any of the actual work... The client launches the core process, and it'll terminate and re-launch the core each time it finishes with a work unit. So whenever that happens, the core process will become "unbound" again even if I set affinity manually previously.

I need to see if there are any command line switches in the folding client to force CPU affinity... If there isn't any such options then I suppose I'll simply have to deal with it as it is now... Meh.
 
No one uses the Win SMP client. You really should run the Linux SMP client via VM. VMWare Player 3.0 just came out, supports 4 threads, and is totally free. Another option is to run multiple instances of the FAH console client and just set a different machine ID for each (install to different folders as well).
 
doesnt windows automatically balance the load ?

Depends on application I believe.
"85" is AFAIK the windows number for 8 cores / threads for particular app, for example in case of WoW it defaults to 2 cores, but can be set to run on more cores with SET processAffinityMask "x" in the games config.wtf; 7 for triplecores, 15 for quads and 85 for octas
 
You really should run the Linux SMP client via VM.
Can't be arsed. I want the little systray icon so I can easily monitor and pause the folding, should I need all my PC's power for whatever purpose. Even if you set minimum priority the folding still pollutes the CPU caches really bad and cause huge performance issues in many games, having to screw around with a virtual machine is just too much work for me...

Thanks for the tip though. ;)

Davros,
Windows DOES do load balancing, but it does it by bouncing tasks around between the physical and virtual cores (well, they're equally physical really, but I hope you know what I mean :)), making the CPU load graph look like a damn seismogram... There's no point in juggling tasks around like that, all it does is cause cache flushes and pipeline stalls when the workload is switched from one core to another.
 
Windows' thread manager doesn't seem to distinguish between physical/HT on i5/i7. It sees 8 equally viable logical cores. That way two threads can run on the same physical core. This was a problem with Linx performance.

I hate how Windows keeps switching threads around cores. I can't rely on cpu usage in task manager to see which software is dual threaded since it switches single threaded software around both cores on my e5200.
 
Last edited by a moderator:
The process affinity mask of the father process is inherited by the child [http://msdn.microsoft.com/en-us/library/ms683463%28VS.85%29.aspx]

So you could try to change the affinity to the client so that the spawned core process will inherit the aff. mask.
One way to do it manually is with Process Explorer, get it here:
http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

I just realized an external launcher wouldn't do any good...

The thing is, I run four instances of the standard Folding@Home single-core CPU client (due to the SMP clients being too quirky and annoying to deal with), and thought it would be real nice if I could bind each client to a single CPU core.

The problem is that it isn't the client that does any of the actual work... The client launches the core process, and it'll terminate and re-launch the core each time it finishes with a work unit. So whenever that happens, the core process will become "unbound" again even if I set affinity manually previously.

I need to see if there are any command line switches in the folding client to force CPU affinity... If there isn't any such options then I suppose I'll simply have to deal with it as it is now... Meh.
 
Back
Top