-prof, -threaded, and -N

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

-prof, -threaded, and -N

Lars Kuhtz
Hi,

The behavior of the -N flag (without argument) with the profiling runtime seems inconsistent compared to the behavior without profiling. The following program

```
module Main where

import GHC.Conc

main :: IO ()
main = print numCapabilities
```

when compiled with `ghc -threaded -fforce-recomp Prof.hs` and run as `./Prof +RTS -N` prints `2` on my machine. When the same program is compiled with `ghc -threaded -fforce-recomp -prof Prof.hs` and executed as `./Prof +RTS -N` it prints `1`.

When an argument is provided to `-N` (e.g. `./Prof +RTS -N2`) the profiling and non-profiling versions behave the same.

I tested this with GHC-7.10.1 but I think that I already observed the same behavior with GHC-7.8.

Is this inconsistency intended?

Lars
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: -prof, -threaded, and -N

Lars Kuhtz
From https://github.com/ghc/ghc/blob/master/rts/RtsFlags.c#L1238 it seems that the behavior described in my email below is intended:

```

                if (rts_argv[arg][2] == '\0') {
#if defined(PROFILING)
                    RtsFlags.ParFlags.nNodes = 1;
#else
                    RtsFlags.ParFlags.nNodes = getNumberOfProcessors();
#endif
```

So, my question is: what is the reason for this difference between the profiling and the non-profiling case?

Lars

> On Jun 2, 2015, at 10:20 PM, Lars Kuhtz <[hidden email]> wrote:
>
> Hi,
>
> The behavior of the -N flag (without argument) with the profiling runtime seems inconsistent compared to the behavior without profiling. The following program
>
> ```
> module Main where
>
> import GHC.Conc
>
> main :: IO ()
> main = print numCapabilities
> ```
>
> when compiled with `ghc -threaded -fforce-recomp Prof.hs` and run as `./Prof +RTS -N` prints `2` on my machine. When the same program is compiled with `ghc -threaded -fforce-recomp -prof Prof.hs` and executed as `./Prof +RTS -N` it prints `1`.
>
> When an argument is provided to `-N` (e.g. `./Prof +RTS -N2`) the profiling and non-profiling versions behave the same.
>
> I tested this with GHC-7.10.1 but I think that I already observed the same behavior with GHC-7.8.
>
> Is this inconsistency intended?
>
> Lars
> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: -prof, -threaded, and -N

Simon Marlow-7
That's a leftover from when profiling didn't support -N, I'll fix it.
Thanks!

Simon

On 03/06/2015 07:03, Lars Kuhtz wrote:

>  From https://github.com/ghc/ghc/blob/master/rts/RtsFlags.c#L1238 it seems that the behavior described in my email below is intended:
>
> ```
>
>                  if (rts_argv[arg][2] == '\0') {
> #if defined(PROFILING)
>                      RtsFlags.ParFlags.nNodes = 1;
> #else
>                      RtsFlags.ParFlags.nNodes = getNumberOfProcessors();
> #endif
> ```
>
> So, my question is: what is the reason for this difference between the profiling and the non-profiling case?
>
> Lars
>
>> On Jun 2, 2015, at 10:20 PM, Lars Kuhtz <[hidden email]> wrote:
>>
>> Hi,
>>
>> The behavior of the -N flag (without argument) with the profiling runtime seems inconsistent compared to the behavior without profiling. The following program
>>
>> ```
>> module Main where
>>
>> import GHC.Conc
>>
>> main :: IO ()
>> main = print numCapabilities
>> ```
>>
>> when compiled with `ghc -threaded -fforce-recomp Prof.hs` and run as `./Prof +RTS -N` prints `2` on my machine. When the same program is compiled with `ghc -threaded -fforce-recomp -prof Prof.hs` and executed as `./Prof +RTS -N` it prints `1`.
>>
>> When an argument is provided to `-N` (e.g. `./Prof +RTS -N2`) the profiling and non-profiling versions behave the same.
>>
>> I tested this with GHC-7.10.1 but I think that I already observed the same behavior with GHC-7.8.
>>
>> Is this inconsistency intended?
>>
>> Lars
>> _______________________________________________
>> Glasgow-haskell-users mailing list
>> [hidden email]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> [hidden email]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
>
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users