[GHC] #11615: ghci -threaded

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- ... gives: Warning: -debug, -threaded and -ticky are ignored by GHCi How can I use -threaded in ghci? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): `-threaded` is a link-time option, and ghci is linked with the threaded RTS, so it is always threaded (assuming you don't have an unusual configuration; `ghc +RTS --info | grep 'RTS way'` to check, should contain `_thr`). It is never `-debug` or `-ticky` (again unless you built it that way on purpose). We could make that warning say more clearly that `-threaded` is redundant, and `-debug` and `-ticky` are ignored. But strangely that warning has disappeared in 8.0 and HEAD, even though the code to print it still seems to exist. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by franz): You are correct, the given command returns a string which contains "hr". I have a function "f" that should run on multiple threads. A compiled program (using "ghc -threaded") containing "main = f" runs multithreaded, like I want to. When I however start "ghci +RTS -N" and than manually run "f", the program runs only on one thread. Mh. Any ideas? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by franz): I have some more information about the problem: I found out that the problem occurs only when I run "cabal exec ghci +RTS -N". When I run it without "cabal exec", getNumCapabilities returns the correct number of kernels, but within "cabal exec ghci +RTS -N" or "cabal repl +RTS -N", the number of kernels is 1. (Even though also "cabal exec ghci +RTS --info" contains "_thr"! Any ideas? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): Yes, because `cabal` is also written in Haskell. So you ran `cabal exec ghci` itself with multiple capabilities, which is not what you wanted. You could say something like `cabal --RTS exec ghci +RTS -N`, I guess. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by franz): Your guess did not work. I have however tried to set the "+RTS -N" in the Haskell code: {{{ m <- getNumProcessors setNumCapabilities m }}} This did actually work! My problem is solved, but the question remains: why does "cabal repl +RTS -N" and "cabal ghci +RTS -N" not work as expected? The options seem not to "reach" ghc! rwbarton: Thank you very much for your appreciated help! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): They don't reach ghci because they are consumed by the Haskell RTS of `cabal` instead. Apparently this is the way to pass additional arguments to `cabal exec`: {{{ cabal exec -- ghci +RTS -N }}} And this works because options after `--` are not processed by the RTS. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): Or: {{{ cabal repl --ghc-options='+RTS -N2' }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by franz): Thank you very much! Both solutions work! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11615: ghci -threaded -------------------------------------+------------------------------------- Reporter: franz | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by franz): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11615#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC