Results 1 to 3 of 3

Thread: Multi Processor tweaks

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    3

    Multi Processor tweaks

    Just a quick question here. Where is the switch to turn on the multiprocessor compilation? When I do kernel compiles it uses both processor equally but when I do the SEQ compiles it will alternate between processors. I'm guessing that it's in my makefile but I was hoping that I could get a jump start on where to look specificaly.

    Ok, after typing this up I felt bad that I hadn't done any work on it so I now know that you need a -j2 as a command option for gcc to use two threads to compile (use two processors). This won't have an effect on single processor guys expect for that the error messages when they come out might not necessarily be in the right order.

    But....

    I still don't know where to add this to make it take effect.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    1,262
    just type make -j2. It is make that will use 2 processors (by spawning 2 copies of gcc at once), gcc only uses one.

    --Jeeves
    "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." --Albert Einstein

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    42
    Ashe,

    Using multiple parrallel jobs with make is not only beneficial to SMP systems. In many circumstances an additional thread will assist in hiding the latency introduced to your compile time by disk I/O. A good example of this would be a large source tree that uses many files (the kernel is an example of this). On a uniprocessor machine try `time make` then `time make -j2`. You will notice a significant reduction in the amount of wall time required. For SMP systems I generally use make -j (#CPU's + (#CPU's / 2)).

    Cheers,
    -Egg

    btw - for the time tests be sure to `make clean` between tests.
    I'm just another fsck uucp.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On