Connecting Tech Pros Worldwide Forums | Help | Site Map

dual opteron prog. help

kingsolomon2000@yahoo.com
Guest
 
Posts: n/a
#1: Oct 13 '06
Hi!

Can anyone please show me an example how to write a very simple C
program such that it runs on a specific processor?

I want to run a very simple program, 2 programs identical, and one runs
one one processor and the other program (same one) runs on a different
processor.

How do I specify which processor in the code to force the program to
run on a specific processor.

ex: would be if I ran the 2 programs on the same processor, it should
run slower but if ran on separate processors (I have a dual opteron
244) the programs should run at their normal speed. I know they won't
increase in speed but I want to specify in code how to choose a
processor.

I have Fedora Core 3 at the moment.

I would be most grateful for any help!

Tom St Denis
Guest
 
Posts: n/a
#2: Oct 13 '06

re: dual opteron prog. help



kingsolomon2000@yahoo.com wrote:
Quote:
Hi!
>
Can anyone please show me an example how to write a very simple C
program such that it runs on a specific processor?
>
I want to run a very simple program, 2 programs identical, and one runs
one one processor and the other program (same one) runs on a different
processor.
>
How do I specify which processor in the code to force the program to
run on a specific processor.
>
ex: would be if I ran the 2 programs on the same processor, it should
run slower but if ran on separate processors (I have a dual opteron
244) the programs should run at their normal speed. I know they won't
increase in speed but I want to specify in code how to choose a
processor.
Not a comp.lang.c subject but look at sched_setaffinity().

Tom

Clever Monkey
Guest
 
Posts: n/a
#3: Oct 13 '06

re: dual opteron prog. help


kingsolomon2000@yahoo.com wrote:
Quote:
Can anyone please show me an example how to write a very simple C
program such that it runs on a specific processor?
>
Probably off-topic here. See if Googling "processor affinity" yields
anything helpful, or consult your system documentation.

I suspect anything you find will be extremely platform specific,
requiring platform specific, non-Standard APIs in whatever language you
choose.
Closed Thread