并行 haskell (ghc 6.10.4) 不接受 -N 大于 -N1
我正在尝试在 OS X 10.5 上的 GHC 6.10.4(来自 MacPorts)中运行并行代码
,我正在 makefile 中使用 -threaded 进行构建:
GHC=ghc -prof -auto-all -O -threaded glicko: glicko.hs Lib.hs $(GHC) --make -main-is Glicko glicko.hs lib.hs
当我调用 ./glicko +RTS -N
时或 ./glicko +RTS -N1
代码运行,但似乎只使用一个 CPU。如果我调用 ./glicko +RTS -N2
,那么我会收到记录命令行参数的运行时帮助消息;但文档表明这应该运行该程序。
为什么-N2 不起作用?
以下是更多时间信息:
$ ./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") ]
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") ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已使用分析和线程进行编译。分析器仅在具有 1 个 cpu 的多核模式下工作(运行时中的分析数据结构不是' t 线程安全)。
编译您的程序而不进行分析,您将能够使用超过 -N1 的内容,
请参阅 票号#886
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