并行 haskell (ghc 6.10.4) 不接受 -N 大于 -N1

发布于 2024-09-15 20:22:16 字数 1029 浏览 1 评论 0原文

我正在尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

命比纸薄 2024-09-22 20:22:17

RTS方式", "rts_thr_p"

您已使用分析线程进行编译。分析器仅在具有 1 个 cpu 的多核模式下工作(运行时中的分析数据结构不是' t 线程安全)。

编译您的程序而不进行分析,您将能够使用超过 -N1 的内容,

请参阅 票号#886

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文