]>
Commit | Line | Data |
---|---|---|
6ef17b23 MT |
1 | From 879abfa1d86f820326bd8edab5e7d5c8991cc9f0 Mon Sep 17 00:00:00 2001 |
2 | From: Michael Tremer <michael.tremer@ipfire.org> | |
3 | Date: Sun, 3 Feb 2013 21:36:30 +0100 | |
4 | Subject: [PATCH 3/4] Revert "A new try to get the parallelism straight." | |
5 | ||
6 | This reverts commit 369ac3b365091ba1a26fb266a94d97adb3719cbc | |
7 | and obviously this is not a solution either. | |
8 | --- | |
9 | python/pakfire/system.py | 7 ++++++- | |
10 | 1 file changed, 6 insertions(+), 1 deletion(-) | |
11 | ||
12 | diff --git a/python/pakfire/system.py b/python/pakfire/system.py | |
13 | index 6f67d31..a9154de 100644 | |
14 | --- a/python/pakfire/system.py | |
15 | +++ b/python/pakfire/system.py | |
16 | @@ -156,10 +156,15 @@ class System(object): | |
17 | Calculates how many processes should be run | |
18 | simulatneously when compiling. | |
19 | """ | |
20 | + # Check how many processes would fit into the | |
21 | + # memory when each process takes up to 500MB. | |
22 | + multiplicator = self.memory / (500 * 1024 * 1024) | |
23 | + multiplicator = round(multiplicator) | |
24 | + | |
25 | # Count the number of online CPU cores. | |
26 | cpucount = os.sysconf("SC_NPROCESSORS_CONF") | |
27 | ||
28 | - return cpucount * 2 | |
29 | + return min(multiplicator, cpucount * 2) | |
30 | ||
31 | ||
32 | # Create an instance of this class to only keep it once in memory. | |
33 | -- | |
34 | 1.7.11.7 | |
35 |