Click to See Complete Forum and Search --> : How to run a program on a specific cpu in a SMP system?


otheos
12-05-2001, 10:18 PM
I need to test lmsensors and I thought if I could set seti@home to run on a specific CPU at a time I could monitor the changes and see which sensors is which.

Any ideas on how to specify and restrict to one cpu?

thanks.

error27
12-06-2001, 03:38 AM
You can't do that with a standard kernel.

I think that there are patches that let you do that.
http://people.redhat.com/mingo/set-affinity-patches/

But I don't know very much about it.

deadlock
12-06-2001, 08:32 AM
Launch the program, then open task manager (right-click on the taskbar) and right-click on the process that you want to alter. From the Set Affinity sub-menu, choose the CPU that you want the process to run on. Windows NT/2k will remember which CPU you chose and will always run that process on that processor.

Oh wait, did I say Windows ? :)

error27
12-06-2001, 08:47 PM
Linux doesn't support it because we don't want to support it.

If we wanted to, it's a simple matter for Linus to type "cat affinity-blah-blah | patch -p0" and just like that Linux has that feature.

But we are too l33t to support it.

So there.

(actually I haven't got the faintest clue why Linux programmers haven't decided to include the patch. probably there's a good reason of some kind. perhaps people are planning on changing a bunch of the multiprocessor code in the 2.5 kernel and don't care about that particular feature right now.)