]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blob - pakfire/patches/0011-build-parallelism-New-way-to-figure-that-out.patch
pakfire: Import latest patches from upstream.
[people/ms/ipfire-3.x.git] / pakfire / patches / 0011-build-parallelism-New-way-to-figure-that-out.patch
1 From f7a632ab069e3439f312023fc599dc659c197568 Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Sun, 3 Feb 2013 21:40:16 +0100
4 Subject: [PATCH 11/17] build parallelism: New way to figure that out.
5
6 The system will now use either the old formula,
7 CPU cores * 2 + 1 or the amount of memory in megabytes devided
8 by 128 (i.e. each compiler process can have 128M RAM) which ever
9 is less.
10 ---
11 python/pakfire/system.py | 9 +++++----
12 1 file changed, 5 insertions(+), 4 deletions(-)
13
14 diff --git a/python/pakfire/system.py b/python/pakfire/system.py
15 index a9154de..6d54d5f 100644
16 --- a/python/pakfire/system.py
17 +++ b/python/pakfire/system.py
18 @@ -157,14 +157,15 @@ class System(object):
19 simulatneously when compiling.
20 """
21 # Check how many processes would fit into the
22 - # memory when each process takes up to 500MB.
23 - multiplicator = self.memory / (500 * 1024 * 1024)
24 + # memory when each process takes up to 128MB.
25 + multiplicator = self.memory / (128 * 1024 * 1024)
26 multiplicator = round(multiplicator)
27
28 # Count the number of online CPU cores.
29 - cpucount = os.sysconf("SC_NPROCESSORS_CONF")
30 + cpucount = os.sysconf("SC_NPROCESSORS_CONF") * 2
31 + cpucount += 1
32
33 - return min(multiplicator, cpucount * 2)
34 + return min(multiplicator, cpucount)
35
36
37 # Create an instance of this class to only keep it once in memory.
38 --
39 1.8.1.2
40