Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Setting affinity of a running process?
New Posts  All Forums:Forum Nav:

Setting affinity of a running process?

post #1 of 4
Thread Starter 
First of all. If there was a T-Shirt that read.

"Everything I've learned about Linux was from Folding"

I would be wearing that T-Shirt.

I have figured out a number of things, but I am struggling with a problem.

I can use the taskset command to launch a program and define processor affinity for that process.

Example:
taskset -c 0,1 ./fah5

This will launch the ./fah5 program and force it to only use processor core 0 and 1.
The ./fah5 process in turn launches 4 of its own child processes that inherit the same affinity mask.

My problem is that I need to set the child processes to a specific processor core. From what I have read I should be able to use:

taskset -p -c 0 <processid>

This should set the process with the id <processid> to only use processor core 0, but it does not.

So my question is, how do I change the affinity of a process that is already running?
Folding Rigs
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD or Intel Anything with a lot of GPU Slots PPD Cruncher Just enough to fold. 
Hard DriveOptical DriveMonitorPower
Smallest Possible None None Whatever it takes 
Case
Bare Naked 
  hide details  
Reply
Folding Rigs
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD or Intel Anything with a lot of GPU Slots PPD Cruncher Just enough to fold. 
Hard DriveOptical DriveMonitorPower
Smallest Possible None None Whatever it takes 
Case
Bare Naked 
  hide details  
Reply
post #2 of 4
I can't personally help you, but if taskset can do that it will be explained in either
man taskset
or
taskset --help
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
It goes to eleven
(13 items)
 
  
CPUMotherboardGraphicsRAM
E6300 DS3 EVGA 8600GTS 2GB XMS2 DDR2-800 
Hard DriveOSMonitorKeyboard
1.294 TB Arch Linux/XP Samsung 226bw Eclipse II 
PowerCaseMouse
Corsair 520HX Lian-Li v1000B Plus G7 
  hide details  
Reply
post #3 of 4
i agree to looking in the man pages, they are the most helpful thing ever
Bravo
(13 items)
 
  
CPUMotherboardGraphicsRAM
X4 955 @ 3.6 Asus M479T 4870 1GB 8 GB DDR3 
Hard DriveOSPowerCase
160 GB Win 7 Antec 750w Antec 300 
  hide details  
Reply
Bravo
(13 items)
 
  
CPUMotherboardGraphicsRAM
X4 955 @ 3.6 Asus M479T 4870 1GB 8 GB DDR3 
Hard DriveOSPowerCase
160 GB Win 7 Antec 750w Antec 300 
  hide details  
Reply
post #4 of 4
Thread Starter 
I will double check them. I had read through them to figure out how to use it. But what I am experiencing seems to be overriding what I understand it should do.
Thanks for the response, I well let you guys know if I figure it out.
Folding Rigs
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD or Intel Anything with a lot of GPU Slots PPD Cruncher Just enough to fold. 
Hard DriveOptical DriveMonitorPower
Smallest Possible None None Whatever it takes 
Case
Bare Naked 
  hide details  
Reply
Folding Rigs
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD or Intel Anything with a lot of GPU Slots PPD Cruncher Just enough to fold. 
Hard DriveOptical DriveMonitorPower
Smallest Possible None None Whatever it takes 
Case
Bare Naked 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux, Unix
Overclock.net › Forums › Software, Programming and Coding › Operating Systems › Linux, Unix › Setting affinity of a running process?