11 Aug, 2009, Chris Bailey wrote in the 1st comment:
Votes: 0
So I was under the impression that you could set the concurrency level of compilation with a simple switch in make. Like so:
make -j4
It seems to work better than a standard "make" command but it is still only using 2 cores of a single cpu. I want it to use both cores of both Cpu's =(
11 Aug, 2009, David Haley wrote in the 2nd comment:
Votes: 0
This depends on the operating system, I would imagine, and whether or not it will allocate sub-processes of one process across several physical processors (as opposed to allocating sub-processes over the cores of a single processor).
What if you try make -j8?
11 Aug, 2009, Chris Bailey wrote in the 3rd comment:
11 Aug, 2009, David Haley wrote in the 4th comment:
Votes: 0
I use -j4 on a single dual-core CPU setup. I suspect that you didn't see the second CPU being used because the load was not enough to actually use it; the computer was probably spending time blocked in I/O for some of the makes while compiling some of the others. Bumping it up to -j8 would force it to be compiling more things at a time. Even there, note that CPU1 is only being used sporadically.
If I remember correctly, the recommendation is to set -jx, where x = 2*num_cores.
I use -j4 right now. Where are you reading 2 * cores? I'm always looking for fun new things to put in my Makefile :)
12 Aug, 2009, David Haley wrote in the 6th comment:
Votes: 0
I can't remember to be honest. This site just says "a few more jobs than cores"; maybe since I have two cores I mentally filed that away as 4 jobs hence x cores -> 2x jobs. The idea is to specify enough jobs in parallel so that while some are blocking on disk I/O, others can compile. Maybe 8 jobs is too much for 4 cores, and 6 or 7 could be more appropriate? Well, anyhow, the difference is likely to be quite small.
On my laptop that I'm on right now I get the following results:
cpuinfo said:
vendor_id : AuthenticAMD cpu family : 15 model : 36 model name : AMD Turion™ 64 Mobile Technology ML-40 stepping : 2 cpu MHz : 800.000 cache size : 1024 KB
remember the good ole days when there wasn't more than one core and you didn't have neat little tricks like this? I wonder why everybody keeps calling those the "good ole days".
remember the good ole days when there wasn't more than one core and you didn't have neat little tricks like this? I wonder why everybody keeps calling those the "good ole days".
It seems to work better than a standard "make" command but it is still only using 2 cores of a single cpu. I want it to use both
cores of both Cpu's =(