dual opteron prog. help

Discussion in 'C Programming' started by kingsolomon2000@yahoo.com, Oct 13, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Tom St Denis Guest

    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
    Tom St Denis, Oct 13, 2006
    #2
    1. Advertising

  3. 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.
    Clever Monkey, Oct 13, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan
    Replies:
    2
    Views:
    543
  2. js
    Replies:
    0
    Views:
    1,216
  3. Andy
    Replies:
    5
    Views:
    2,811
  4. Rajrup Banerjee

    SGI STL Library on Opteron

    Rajrup Banerjee, May 21, 2004, in forum: C++
    Replies:
    1
    Views:
    300
    Christopher Benson-Manica
    May 21, 2004
  5. -intl.com
    Replies:
    1
    Views:
    354
    Martin Gregorie
    Oct 22, 2006
Loading...

Share This Page