views:

65

answers:

1

I'm trying to run parallel code in GHC 6.10.4 (from MacPorts) on OS X 10.5

I'm building with -threaded, in my makefile:

GHC=ghc -prof -auto-all -O -threaded

glicko: glicko.hs Lib.hs
        $(GHC) --make -main-is Glicko glicko.hs lib.hs

When I invoke ./glicko +RTS -N or ./glicko +RTS -N1 the code runs, but seems to only use one CPU. If i invoke as ./glicko +RTS -N2, then I am given the runtime help message that documents commandline parameters; but the documentation suggests that this should run the program.

Why is -N2 not working?

Here's more time info:

$ ./glicko +RTS --info
 [("GHC RTS", "YES")
 ,("GHC version", "6.10.4")
 ,("RTS way", "rts_thr_p")
 ,("Host platform", "i386-apple-darwin")
 ,("Host architecture", "i386")
 ,("Host OS", "darwin")
 ,("Host vendor", "apple")
 ,("Build platform", "i386-apple-darwin")
 ,("Build architecture", "i386")
 ,("Build OS", "darwin")
 ,("Build vendor", "apple")
 ,("Target platform", "i386-apple-darwin")
 ,("Target architecture", "i386")
 ,("Target OS", "darwin")
 ,("Target vendor", "apple")
 ,("Word size", "32")
 ,("Compiler unregisterised", "NO")
 ,("Tables next to code", "YES")
 ]
+5  A: 

RTS way", "rts_thr_p"

You have compiled with both profiling and threading. The profiler only works in multicore mode with 1 cpu (the profiling data structures in the runtime aren't threadsafe yet).

Compile your program without profiling, and you will be able to use more than -N1.

See ticket #886

Don Stewart