How to use parallel 'for' loop in Octave or Scilab?

前端 未结 4 809
迷失自我
迷失自我 2020-12-19 06:36

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

4条回答
  •  执笔经年
    2020-12-19 07:13

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

    The pararrayfun and parcellfun functions of the parallel package are handy on multicore machines. They are often a good replacement to a parfor loop.

    For examples, see http://wiki.octave.org/Parallel_package. To install, issue (just once)

    pkg install -forge parallel
    

    And then, once on each session

    pkg load parallel
    

    before using the functions

提交回复
热议问题