如何在Octave或Scilab中使用并行的"for"循环? [英] How to use parallel 'for' loop in Octave or Scilab?

查看:513
本文介绍了如何在Octave或Scilab中使用并行的"for"循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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.

当我在google中搜索它时,给出了一些断开的链接.

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).

并行软件包的pararrayfunparcellfun功能在多核计算机上很方便. 它们通常是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, see http://wiki.octave.org/Parallel_package. To install, issue (just once)

pkg install -forge parallel

然后,每个会话一次

pkg load parallel

使用功能之前

这篇关于如何在Octave或Scilab中使用并行的"for"循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆