Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,334
    • Issues 4,334
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 371
    • Merge Requests 371
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4319

Closed
Open
Opened Sep 15, 2010 by tim.v2.0@trac-tim.v2.0

Default to all cores for executables compiled with new flag -multicore

I propose a new flag -multicore, be added to the compiler which will generate an executable that will use all available cores by default. Runtime tuning can remain using the +RTS -Nx -RTS.

Currently, the Haskell wiki shows that you need to both set a compilation flag and a run-time flag to get multi-core support. The compiler flag -threaded is used to enable several disparate behaviors: multi-core support, interact with multi-threaded foreign code and make foreign calls without blocking other Haskell threads. Because of this, it is not always reasonable to use multiple cores for code compiled with -threaded.

Addition of a new flag will tell the compiler, "yes, make code that uses all the cores".

If this is considered too lenient, perhaps it could take an argument. -multicore 50 would use 50% of available cores. -multicore 75 would use 75% of available cores. Etc.

I find Haskell's requirement that I set both compile time and run time flags to use multiple cores obscure and annoying. It is hardly onerous, but it could definitely be improved.

This is filed in response to ticket 4307 being closed. Further, it is filed in response to StackOverflow post http://stackoverflow.com/questions/3704430/why-do-you-have-to-use-both-a-compiler-flag-and-a-run-time-flag-to-get-multicore

Trac metadata
Trac field Value
Version 6.12.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.2.1
Milestone
7.2.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#4319