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

前端 未结 4 813
迷失自我
迷失自我 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:23

    In GNU Octave you can use the parfor construct:

    parfor i=1:10
        # do stuff that may run in parallel
    endparfor
    

    For more info: help parfor

提交回复
热议问题