问题描述
我在我的 Matlab 代码中运行了两个 for 循环.内部循环在 12 个处理器中使用 Matlabpool 并行化(这是 Matlab 在单台机器中允许的最大值).
I have two for loops running in my Matlab code. The inner loop is parallelized using Matlabpool in 12 processors (which is maximum Matlab allows in a single machine).
我没有分布式计算许可证.请帮助我如何使用 Octave 或 Scilab 做到这一点.我只想并行化for"循环.
I dont have Distributed computing license. Please help me how to do it using Octave or Scilab. I just want to parallelize 'for' loop ONLY.
我在谷歌搜索时给出了一些损坏的链接.
There are some broken links given while I searched for it in google.
推荐答案
parfor
还没有真正在八度音阶中实现.关键字被接受,但只是 for
的同义词 (http://Octave.1599824.n4.nabble.com/Parfor-td4630575.html).
parfor
is not really implemented in octave yet. The keyword is accepted, but is a mere synonym of for
(http://octave.1599824.n4.nabble.com/Parfor-td4630575.html).
并行包的pararrayfun
和parcellfun
函数在多核机器上很方便.它们通常可以很好地替代 parfor 循环.
The pararrayfun
and parcellfun
functions of the parallel package are handy on multicore machines.They are often a good replacement to a parfor loop.
示例见http://wiki.octave.org/Parallel_package.要安装,请发出(仅一次)
For examples, seehttp://wiki.octave.org/Parallel_package.To install, issue (just once)
pkg install -forge parallel
然后,每个会话一次
pkg load parallel
使用功能前
这篇关于如何在 Octave 或 Scilab 中使用并行“for"循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!