我真的很喜欢Repa
的界面,即使它的并发能力如何。而且我实际上需要 repa 的数组是连续的,因为我的数组是相对较小的数组,并且它们的并行化是无用的,甚至是有害的。
但是,我确实在我的程序中使用并行 io,所以我编译它-threaded
并使用+RTS -Nx
. 这使repa 的并行化成为可能。有没有办法关闭 repa 的并发功能?
嗯,在写这篇文章时,我明白我不太可能需要其他任何东西DIM1
,所以也许我应该切换到Vector
. 但尽管如此,这个问题的答案将是有用的。
我通过并行运行收到的警告消息是
Data.Array.Repa: Performing nested parallel computation sequentially.
You've probably called the 'force' function while another instance was
already running. This can happen if the second version was suspended due
to lazy evaluation. Use 'deepSeqArray' to ensure that each array is fully
evaluated before you 'force' the next one.
我的代码中实际上没有force
。