Opened 11 years ago

Closed 8 years ago

#3210 closed feature request (fixed)

Allow programs to change the number of capabilities

Reported by: NeilMitchell Owned by:
Priority: low Milestone: 7.4.1
Component: Compiler Version: 6.10.2
Keywords: Cc: ndmitchell@…, shelarcy@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

It would be useful for a program to choose the number of capabilities it has, perhaps in response to a flag. i.e. I'd like users to type hlint -j3 rather than hlint +RTS -N3.

To support this change one option would be to allow increasing the number of capabilities after a program has started. Another option would be to provide a primitive restartWithCapabilities :: Int -> IO () that aborted the program, and restarted main but with the required settings.

Using RTS flags is unsuitable for people who use Haskell programs but aren't really Haskell developers. As more programs go multi-core, this feature will probably become more desirable. However, it's not too important and can always be solved by a little shell script.

Change History (9)

comment:1 Changed 11 years ago by igloo

difficulty: Unknown
Milestone: 6.12 branch

comment:2 Changed 10 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:3 Changed 10 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:4 Changed 10 years ago by shelarcy

Cc: shelarcy@… added
Type of failure: None/Unknown

comment:5 Changed 9 years ago by igloo

Milestone: 7.0.17.0.2

comment:6 Changed 9 years ago by igloo

Milestone: 7.0.27.2.1

comment:7 Changed 8 years ago by igloo

Milestone: 7.2.17.4.1

comment:8 Changed 8 years ago by simonmar

commit 92e7d6c92fdd14de424524564376d3522f2a40cc

Author: Simon Marlow <marlowsd@gmail.com>
Date:   Tue Dec 6 15:12:07 2011 +0000

    Allow the number of capabilities to be increased at runtime (#3729)
    
    At present the number of capabilities can only be *increased*, not
    decreased.  The latter presents a few more challenges!

 docs/users_guide/using.xml |   14 +++-
 includes/rts/Threads.h     |   10 +++
 rts/Capability.c           |   66 ++++++++++++-----
 rts/Capability.h           |    6 ++-
 rts/Linker.c               |    1 +
 rts/Schedule.c             |  172 ++++++++++++++++++++++++++++++++++++--------
 rts/Stats.c                |    2 +-
 rts/Task.c                 |   28 +++++++
 rts/Task.h                 |    5 ++
 rts/Trace.c                |    7 ++
 rts/Trace.h                |    1 +
 rts/eventlog/EventLog.c    |   27 ++++++--
 rts/eventlog/EventLog.h    |    1 +
 rts/sm/GC.c                |   50 ++++++++-----
 rts/sm/GC.h                |    2 +-
 rts/sm/Storage.c           |   70 +++++++++++--------
 rts/sm/Storage.h           |    4 +
 17 files changed, 358 insertions(+), 108 deletions(-)

comment:9 Changed 8 years ago by simonmar

Resolution: fixed
Status: newclosed

I think we now handle the use case given in this ticket, and we also have #3729 which covers the remaining issues, so I'll close this one.

Note: See TracTickets for help on using tickets.