wshcdr
wshcdr

Reputation: 967

What's the meaning of core number in ThreadScope?

I'm confused with the ThreadScope usage, when I want to profile my haskell program, and follow the steps:

> ghc -threaded -eventlog -rtsopts --make test.hs
> test.exe +RTS -ls -N2
> threadscope test.exe.eventlog

and I find two cores in threadscope , but when I modify step two like:

> test.exe +RTS -ls -N6

(I actually have four cores in my computer), threadscope show 6 cores in its user interface, what's that meaning?

Upvotes: 2

Views: 138

Answers (1)

Zeta
Zeta

Reputation: 105886

That aren't cores, but HECs:

The program displays the activity on each Haskell Execution Context (HEC) which roughly corresponds to an operating system thread.

And -N[x] will set the number of threads to x:

-N[x]

Use x simultaneous threads when running the program. Normally x should be chosen to match the number of CPU cores on the machine. For example, on a dual-core machine we would probably use +RTS -N2 -RTS.

Omitting x, i.e. +RTS -N -RTS, lets the runtime choose the value of x itself based on how many processors are in your machine.

And since you used -N6, you observe 6 HECs.

Upvotes: 2

Related Questions