Parallelize the balancing computations
authorIustin Pop <iustin@google.com>
Fri, 17 Dec 2010 15:52:40 +0000 (16:52 +0100)
committerIustin Pop <iustin@google.com>
Thu, 30 Dec 2010 13:56:37 +0000 (14:56 +0100)
commita3eee4ad50f102140a4dc3a99df9cbc69aa22f9b
tree2061d4bbf500c665ad5ac4b7873e23d2800a106d
parentd5ccec0230d745ce01320e710b27b9c4c0c246e9
Parallelize the balancing computations

This small patch changes the balancing computation to work in
parallel, if possible.

While the normal linking is against the single-threaded runtime, if
the code is linked against the multi-threaded one, the balancing will
get a significant speedup (80% efficiency at 4 cores, 60% at 12 cores,
and with GC tweaks it can reach 70%+).

On the single-threaded runtime, due to the fact that we only use the
weak head normal form, it doesn't introduce any extra penalties,
neither in space nor in CPU time (or if there are, they are too small
to detect easily).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
Ganeti/HTools/Cluster.hs
README