]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
Revert "A new try to get the parallelism straight."
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 3 Feb 2013 20:36:30 +0000 (21:36 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 3 Feb 2013 20:36:30 +0000 (21:36 +0100)
This reverts commit 369ac3b365091ba1a26fb266a94d97adb3719cbc
and obviously this is not a solution either.

python/pakfire/system.py

index 6f67d311ff97a7688065628d76d27d52883fa7ed..a9154de98c7ec53719423f7ff37fb7c4c38b9c3b 100644 (file)
@@ -156,10 +156,15 @@ class System(object):
                        Calculates how many processes should be run
                        simulatneously when compiling.
                """
+               # Check how many processes would fit into the
+               # memory when each process takes up to 500MB.
+               multiplicator = self.memory / (500 * 1024 * 1024)
+               multiplicator = round(multiplicator)
+
                # Count the number of online CPU cores.
                cpucount = os.sysconf("SC_NPROCESSORS_CONF")
 
-               return cpucount * 2
+               return min(multiplicator, cpucount * 2)
 
 
 # Create an instance of this class to only keep it once in memory.