代码之家  ›  专栏  ›  技术社区  ›  Ben Clifford

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

  •  0
  • Ben Clifford  · 技术社区  · 14 年前

    我正在尝试在OSX10.5上运行GHC6.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")
     ]
    
    1 回复  |  直到 14 年前
        1
  •  5
  •   Don Stewart    14 年前

    RTS方式,“RTS thr p”

    剖析 . 探查器只能在多核模式下使用1个cpu(运行时中的探查数据结构还不是线程安全的)。

    编译您的程序而不进行分析,您将能够使用-N1以上。

    ticket #886