help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave multi threading.


From: vrozos
Subject: Re: Octave multi threading.
Date: Fri, 25 Sep 2020 04:43:37 -0500 (CDT)

Ilaya Bharathi wrote
>    3. Apart from the above questions, I want to know what is a parallel
>    computing or parallel execution package for Octave. Are they similar to
>    Open Blas ? and what platform do they support ?

Quoted from: 
https://octave.1599824.n4.nabble.com/Octave-multi-threading-tp4697593p4698204.html

Below an example of parallel Octave package
(https://octave.sourceforge.io/parallel/index.html). The isOctave if-branch
employs parcellfun to enable parallel computing. The else-branch is the
equivalent without parallel computing.

function displacements= wrap_getdisplacements_mp( frames, framerange, ...
                                                  video, T, isOctave )
  frames_rolled={ frames{2:end}, frames{1} };
  if isOctave
    displacements= parcellfun ( nproc, @getdisplacements_mp, ...
                           frames(framerange), ...
                           frames_rolled(framerange), ...
                           repmat ({video}, 1, length (framerange)), ...
                           repmat ( {T}, 1, length (framerange)), ...
                           "UniformOutput", 0);
  else
    displacements=cell(1, length(frames));
    for j= 1:length(frames)
      displacements{j}= getdisplacements_mp ( frames{j}, ...
                            frames_rolled{j}, video, T );
    end
  end
    
  displacements=vertcat( displacements {:} )';                           
end




--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]