How to run a program on multiple CPUs - Linux

This is a discussion on How to run a program on multiple CPUs - Linux ; Hi there, My Linux machine (kernel 2.6.9) has two processors. When I run a program, it takes almost 100% of one CPU, while the other is almost idle. How could I run the program on two CPUs so that I ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: How to run a program on multiple CPUs

  1. How to run a program on multiple CPUs

    Hi there,
    My Linux machine (kernel 2.6.9) has two processors.
    When I run a program, it takes almost 100% of one CPU, while the other is
    almost idle.
    How could I run the program on two CPUs so that I could take advantage of
    the dual-CPU benefit?

    Any idea would be appreciated,
    Ross



  2. Re: How to run a program on multiple CPUs

    On Tue, 04 Dec 2007 11:00:16 -0500, Ross wrote:

    > Hi there,
    > My Linux machine (kernel 2.6.9) has two processors.
    > When I run a program, it takes almost 100% of one CPU, while the other is
    > almost idle.
    > How could I run the program on two CPUs so that I could take advantage of
    > the dual-CPU benefit?
    >
    > Any idea would be appreciated,
    > Ross


    Quite simple, really. All you have to do is rewrite the program to use
    independent threads. You might want to read about parallel processing.


  3. Re: How to run a program on multiple CPUs

    ["Followup-To:" header set to comp.os.linux.misc.]

    On 2007-12-04, Ross wrote:
    > My Linux machine (kernel 2.6.9) has two processors.
    > When I run a program, it takes almost 100% of one CPU, while the other is
    > almost idle.
    > How could I run the program on two CPUs so that I could take advantage of
    > the dual-CPU benefit?


    What program is it? There are a few programs that already support
    running on multiple processors, usually via a commandline switch. If
    it's not written to do so, then as others have already written, you need
    to rewrite the program.

    --keith

    --
    kkeller-usenet@wombat.san-francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    see X- headers for PGP signature information


  4. Re: How to run a program on multiple CPUs

    On Tue, 4 Dec 2007 11:00:16 -0500, Ross wrote:
    >Hi there,
    >My Linux machine (kernel 2.6.9) has two processors.
    >When I run a program, it takes almost 100% of one CPU, while the other is
    >almost idle.
    >How could I run the program on two CPUs so that I could take advantage of
    >the dual-CPU benefit?


    >Any idea would be appreciated,
    >Ross



    For starters get rid of the busy waiting.


  5. Re: How to run a program on multiple CPUs

    On Wed, 05 Dec 2007 10:59:44 -0500, Ross wrote:

    > Thanks Ray and Keith.
    > But I don't think I could rewrite the program which is Oracle Express.
    >
    > I thought there might be a way to run the command with some options to force
    > the program to run on multiple processors.
    >
    > Thanks again,
    > Ross
    >


    The other option is if you can somehow subdivide the job and run as two
    tasks.


    > "Keith Keller" wrote in message
    > news:crig25xlmq.ln2@goaway.wombat.san-francisco.ca.us...
    >> ["Followup-To:" header set to comp.os.linux.misc.]
    >>
    >> On 2007-12-04, Ross wrote:
    >>> My Linux machine (kernel 2.6.9) has two processors.
    >>> When I run a program, it takes almost 100% of one CPU, while the other is
    >>> almost idle.
    >>> How could I run the program on two CPUs so that I could take advantage of
    >>> the dual-CPU benefit?

    >>
    >> What program is it? There are a few programs that already support
    >> running on multiple processors, usually via a commandline switch. If
    >> it's not written to do so, then as others have already written, you need
    >> to rewrite the program.
    >>
    >> --keith
    >>
    >> --
    >> kkeller-usenet@wombat.san-francisco.ca.us
    >> (try just my userid to email me)
    >> AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    >> see X- headers for PGP signature information
    >>



  6. Re: How to run a program on multiple CPUs

    Thanks Ray and Keith.
    But I don't think I could rewrite the program which is Oracle Express.

    I thought there might be a way to run the command with some options to force
    the program to run on multiple processors.

    Thanks again,
    Ross

    "Keith Keller" wrote in message
    news:crig25xlmq.ln2@goaway.wombat.san-francisco.ca.us...
    > ["Followup-To:" header set to comp.os.linux.misc.]
    >
    > On 2007-12-04, Ross wrote:
    >> My Linux machine (kernel 2.6.9) has two processors.
    >> When I run a program, it takes almost 100% of one CPU, while the other is
    >> almost idle.
    >> How could I run the program on two CPUs so that I could take advantage of
    >> the dual-CPU benefit?

    >
    > What program is it? There are a few programs that already support
    > running on multiple processors, usually via a commandline switch. If
    > it's not written to do so, then as others have already written, you need
    > to rewrite the program.
    >
    > --keith
    >
    > --
    > kkeller-usenet@wombat.san-francisco.ca.us
    > (try just my userid to email me)
    > AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
    > see X- headers for PGP signature information
    >




  7. Re: How to run a program on multiple CPUs

    Ross wrote:
    > Hi there,
    > My Linux machine (kernel 2.6.9) has two processors.
    > When I run a program, it takes almost 100% of one CPU, while the other is
    > almost idle.
    > How could I run the program on two CPUs so that I could take advantage of
    > the dual-CPU benefit?


    You can't unless the software supports it.

    --
    artix
    http://www.abstractart.ws _Abstract Art Directory_

  8. Re: How to run a program on multiple CPUs

    ray wrote:
    > On Wed, 05 Dec 2007 10:59:44 -0500, Ross wrote:


    >>
    >> I thought there might be a way to run the command with some options to force
    >> the program to run on multiple processors.

    >
    > The other option is if you can somehow subdivide the job and run as two
    > tasks.
    >
    >


    AFAIK, Oracle Express does not even support more than 1 CPU. (meaning
    the RDBMS won't use more than 1 even if you have 64 of them). Oracle MTS
    is multithreaded (and expensive) but still your transactions are
    generally serializable (prevention of deadlocks and such) so even if you
    have a huge load of CPU's and a RDBMS that supports multithreading, the
    transactions will generally not be executed in a parallel way.

    But does a single transaction use up all of your CPU? Is it not rather
    I/O that fills up the pipeline (Memory and/or disk)?

    -R-

+ Reply to Thread