By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,939 Members | 1,600 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,939 IT Pros & Developers. It's quick & easy.

dual opteron prog. help

P: n/a
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!

Oct 13 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

ki*************@yahoo.com wrote:
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

Oct 13 '06 #2

P: n/a
ki*************@yahoo.com wrote:
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.
Oct 13 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.