How give tasks to individual processors in a multicore processor ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How give tasks to individual processors in a multicore processor ?
# 1  
Old 07-29-2008
How give tasks to individual processors in a multicore processor ?

Hi all,

Using shell script, how to assign tasks to individual processors in a multicore processor ? For example: If I have 4 processors, I want to give one job to each of the processors. (When I give multiple jobs, it's assigning all the load to a single processor. )

Thanks
R
# 2  
Old 07-29-2008
Processor affinity configuration is specific to each OS. If you tell us which specific OS and version and hardware you are using, we may be able to help you.
# 3  
Old 07-29-2008
I am using CentOS linux and with "uname -a", here is the info of my machine:

******
Linux 2.6.18-92.1.6.el5PAE #1 SMP Wed Jun 25 14:21:46 EDT 2008 i686 i686 i386 GNU/Linux
******

and one of the processor info from /proc/cpuinfo is

*********
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU X5355 @ 2.66GHz
stepping : 11
cpu MHz : 2660.134
cache size : 4096 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat
pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monito
r ds_cpl vmx est tm2 cx16 xtpr lahf_lm
*******

Thanks
R
# 4  
Old 07-29-2008
# 5  
Old 07-29-2008
Nice !....Simple and straight to the point...

Thanks...I will try and see...

Ravi
# 6  
Old 07-30-2008
Just thought that I'll post the solution that I found for anyone who is interested.

The command to assign tasks to individual processors in a multicore processor Is:

taskset -c -p <processor number> <PID>

For example, if I have 4 processors and I want to assign PID 1234 to processor number 2, I would write:

taskset -c -p 2 1234

The -c option is to indicate the numerical processor number rather than a bitmask. The -p option is specify not to open a new task and do it on the existing one.

Hope this helps.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. AIX

Processor and processor core

Guys... Hows it going??? I have been going through the hardware spec of IBM system p systems.. and here i am confused for IBM Power 520 Express it says Processor cores: One, two or four 64-bit 4.2 GHz POWER6 with AltiVec™ SIMD and Hardware Decimal Floating-Point acceleration ... (1 Reply)
Discussion started by: balaji_prk
1 Replies

2. AIX

LPAR processor/virtual processor settings

Question is on setting of Physical and Virtual processors for LPARs to make proper use of virtualization capabilities. Environment is a 8-way p570 with 4 LPARs. lparVIO1 and lparVIO2: AIX 5300-04-01 Mode/Type= Shared-SMT/Capped Minimum Processors= 0.10 Desired Processors= 0.50 Maximum... (1 Reply)
Discussion started by: guttew
1 Replies

3. UNIX for Advanced & Expert Users

No: of processors

which unix command can be used to know the no: of processors running on that machine... version used:- Solaris 8.0 (3 Replies)
Discussion started by: bishweshwar
3 Replies

4. HP-UX

How do I detect multicore processors?

I'm fairly new to HP-UX, and I need to know how to identify the number of cores on a PA-8800 processor from the command line. Any help here would be appreciated. (11 Replies)
Discussion started by: Midcain
11 Replies

5. HP-UX

Multicore from a different angle

Everyone seemed to be a little stumped by the multicore question I asked earlier this week, so I decided I'd try a different angle. Turns out that on a multicore system HP-UX reports every core as a seperate processor. All the usual commands (ioscan, top, etc.) report two processors for every... (7 Replies)
Discussion started by: Midcain
7 Replies

6. UNIX for Dummies Questions & Answers

How do I determine # of processors ...

I have a console server that runs some form of UNIX/Linux, but I get a bash shell, and I want to determine how many processor (what speed) and them amount of RAM in the system. (2 Replies)
Discussion started by: bbrandeb49
2 Replies

7. UNIX for Dummies Questions & Answers

Dual processors

I have two sparcstation20's. One has no hard drive or memory and I want to know if there is a way to take the processor out of it and make the other a dual processor. I know it is possible some how just curious if anyone here can help me make this happen. (Don't know much about sun... (3 Replies)
Discussion started by: jwbrown
3 Replies
Login or Register to Ask a Question