[GHC] #14545: -prof causes -N to default to 1

#14545: -prof causes -N to default to 1 -------------------------------------+------------------------------------- Reporter: gelisam | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: MacOS X Architecture: x86_64 | Type of failure: Incorrect result (amd64) | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Given a simple test program which prints `getNumCapabilities`: {{{#!hs import Control.Concurrent main :: IO () main = print =<< getNumCapabilities }}} Compiling this with `-threaded` and running the program with `+RTS -N` is supposed to set the number of capabilities to the number of cores on the machine. This normally prints 8 on my machine: {{{#!bash $ rm -rf Main Main.hi Main.o && ghc -threaded Main.hs && ./Main +RTS -N [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... 8 }}} But when I compile with `-prof`, it prints 1 instead! Expected output: still 8. {{{#!bash $ rm -rf Main Main.hi Main.o && ghc -prof -threaded Main.hs && ./Main +RTS -N [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... 1 }}} If I use `+RTS -N8` instead, it prints 8 as expected. Reproduced with GHC 8.0.2 and GHC 8.8.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14545 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14545: -prof causes -N to default to 1 -------------------------------------+------------------------------------- Reporter: gelisam | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by gelisam: Old description:
Given a simple test program which prints `getNumCapabilities`:
{{{#!hs import Control.Concurrent
main :: IO () main = print =<< getNumCapabilities }}}
Compiling this with `-threaded` and running the program with `+RTS -N` is supposed to set the number of capabilities to the number of cores on the machine. This normally prints 8 on my machine:
{{{#!bash $ rm -rf Main Main.hi Main.o && ghc -threaded Main.hs && ./Main +RTS -N [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... 8 }}}
But when I compile with `-prof`, it prints 1 instead! Expected output: still 8.
{{{#!bash $ rm -rf Main Main.hi Main.o && ghc -prof -threaded Main.hs && ./Main +RTS -N [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... 1 }}}
If I use `+RTS -N8` instead, it prints 8 as expected.
Reproduced with GHC 8.0.2 and GHC 8.8.2.
New description: Given a simple test program which prints `getNumCapabilities`: {{{#!hs import Control.Concurrent main :: IO () main = print =<< getNumCapabilities }}} Compiling this with `-threaded` and running the program with `+RTS -N` is supposed to set the number of capabilities to the number of cores on the machine. This normally prints 8 on my machine: {{{#!bash $ rm -rf Main Main.hi Main.o && ghc -threaded Main.hs && ./Main +RTS -N [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... 8 }}} But when I compile with `-prof`, it prints 1 instead! Expected output: still 8. {{{#!bash $ rm -rf Main Main.hi Main.o && ghc -prof -threaded Main.hs && ./Main +RTS -N [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main ... 1 }}} If I use `+RTS -N8` instead, it prints 8 as expected. Reproduced with GHC 8.0.2 and GHC 8.2.2. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14545#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14545: -prof causes -N to default to 1 -------------------------------------+------------------------------------- Reporter: gelisam | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4245 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D4245 * milestone: => 8.4.1 Comment: Here's a probable fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14545#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14545: -prof causes -N to default to 1
-------------------------------------+-------------------------------------
Reporter: gelisam | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.2.2
Resolution: | Keywords:
Operating System: MacOS X | Architecture: x86_64
Type of failure: Incorrect result | (amd64)
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D4245
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#14545: -prof causes -N to default to 1 -------------------------------------+------------------------------------- Reporter: gelisam | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: Operating System: MacOS X | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4245 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14545#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC