[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Parallel make Order Algorithm
From: |
Martin Dorey |
Subject: |
RE: Parallel make Order Algorithm |
Date: |
Wed, 15 Jul 2015 01:13:59 +0000 |
> I have the feeling that the second algorithm has a bottleneck:
The algorithm you describe is a feature of your makefile(s) rather than make.
Make doesn't really know about the traditional three phases of a large C
project that you describe. It's just as happy driving an assembler, preparing
ingredients for a cake or generating documentation.
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Dilyan Palauzov
Sent: Tuesday, July 14, 2015 05:02
To: address@hidden
Subject: Parallel make Order Algorithm
Hello,
when I run (serial) make, it first compiles the objects files for the
first library, then links the fist library, then it compiles the object
files for the second library, then links the second library. Finally,
for each executable, it compiles the object files and links.
When I run parallel make -j 4, it first compiles all object files (for
the libraries and for the executables), then it links all libraries and
then it links the executables.
I have the feeling that the second algorithm has a bottleneck:
While compiling object files is always possible, linking of programmes
can start, after the dependent libraries are linked. So in the moment,
when all object files are build, and the single library, on which all
executables depend, is being linked, parallel make executes only one
job: linking the library.
I have not measured this with frozen processes, but when I check the
output of make, and the logic behind, i guess the above scenario can happen.
Can you confirm it?
If yes, I propose also in parallel builds to keep the same logic, as
with serial builds, with the addition to compile object files, just in
case no requirements are currently satisfied, to start linkage. Or with
other words, first try to build the final leaves (bin, lib, info) and in
case this cannot be started now for a library, build the first level
(object files) for the next final target(library) as temporary measure,
until the requirements for the linkage are satisfied.
Anyway, I am sure that if see the problem exist, you can also find a
nice solution for it.
Greetings
Dilian
_______________________________________________
Bug-make mailing list
address@hidden
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.gnu.org_mailman_listinfo_bug-2Dmake&d=BQICAg&c=DZ-EF4pZfxGSU6MfABwx0g&r=oBMzc8Omr1YTgjig4n4076T3IKL7TuNH9HpVbojD-ms&m=AlBhQEXGb71rWv9skDavAC0iZGD2sFNv1ULX9JOaXFY&s=-BYdicpvPnRuXDkJIjq7H43Mg5-u4hfkQvH0hfk7p5M&e=