Default +RTS -qn to the number of cores
ClosedPublic

Authored by simonmar on Oct 7 2016, 9:05 AM.

Details

Summary

Setting a -N value that is too large has a dramatic negative effect on
performance, but the new -qn flag can mitigate the worst of the effects
by limiting the number of GC threads.

So now, if you don't explcitly set +RTS -qn, and you set -N larger than
the number of cores (or use setNumCapabilities to do the same), we'll
default -qn to the number of cores.

These are the results from nofib/parallel on my 4-core (2 cores x 2
threads) i7 laptop, comparing -N8 before and after this change.

--------------------------------------------------------------------------------
        Program           Size    Allocs   Runtime   Elapsed  TotalMem
--------------------------------------------------------------------------------
   blackscholes          +0.0%     +0.0%    -72.5%    -72.0%     +9.5%
          coins          +0.0%     -0.0%    -73.7%    -72.2%     -0.8%
         mandel          +0.0%     +0.0%    -76.4%    -75.4%     +3.3%
        matmult          +0.0%    +15.5%    -26.8%    -33.4%     +1.0%
          nbody          +0.0%     +2.4%     +0.7%     0.076      0.0%
         parfib          +0.0%     -8.5%    -33.2%    -31.5%     +2.0%
        partree          +0.0%     -0.0%    -60.4%    -56.8%     +5.7%
           prsa          +0.0%     -0.0%    -65.4%    -60.4%      0.0%
         queens          +0.0%     +0.2%    -58.8%    -58.8%     -1.5%
            ray          +0.0%     -1.5%    -88.7%    -85.6%     -3.6%
       sumeuler          +0.0%     -0.0%    -47.8%    -46.9%      0.0%
--------------------------------------------------------------------------------
            Min          +0.0%     -8.5%    -88.7%    -85.6%     -3.6%
            Max          +0.0%    +15.5%     +0.7%    -31.5%     +9.5%
 Geometric Mean          +0.0%     +0.6%    -61.4%    -63.1%     +1.4%
Test Plan

validate, nofib/parallel benchmarks

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
simonmar retitled this revision from to Default +RTS -qn to the number of cores.Oct 7 2016, 9:05 AM
simonmar updated this object.
simonmar edited the test plan for this revision. (Show Details)
simonmar added reviewers: niteria, ezyang, bgamari, nh2, trofi.
simonmar updated the Trac tickets for this revision.
simonmar updated this object.Oct 7 2016, 9:46 AM
simonmar updated this revision to Diff 8930.Oct 7 2016, 10:02 AM

include doc update

trofi accepted this revision.Oct 7 2016, 1:27 PM

Looks cool! Thank you!

This revision is now accepted and ready to land.Oct 7 2016, 1:27 PM
bgamari accepted this revision.Oct 8 2016, 11:02 AM

Quite a dramatic improvement. Thanks!

This revision was automatically updated to reflect the committed changes.