[Top][All Lists]

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

Re: Octave: Parallelizing a for-loop in Octave.

From: Constantine Frangos
Subject: Re: Octave: Parallelizing a for-loop in Octave.
Date: Fri, 2 Oct 2015 02:36:54 +0200 (SAST)

Hi Carlo,

Thanks for the fast response.

I assume that octave-parallel 2.2.0 is the correct package to
install ?

How is the "parcellfun" command used to replicate the 
parallelized for-loop below ?


----- Original Message -----
From: "Carlo De Falco" <address@hidden>
To: "Constantine Frangos" <address@hidden>
Cc: address@hidden
Sent: Thursday, October 1, 2015 9:29:45 PM
Subject: Re: Octave: Parallelizing a for-loop in Octave.

On 1 Oct 2015, at 14:22, Constantine Frangos <address@hidden> wrote:

> Hi all,
> I am using Octave 3.8 on an intel quad-core cpu running ubuntu linux.
> In Matlab, there is a construct for parallelizing a single for-loop
> as follows:
> function test_parallel;
> ...............
> N = 1000;
> results_vec = zeros(1,N);
> parfor i1 = 1:N
> %Some computations producing y.
> results_vec(i1) = y;
> end;
> .............
> %end of function.
> How can the above construct be implemented in Octave (in order 
> to run on a quad-core cpu) ?
> Thanks.
> Regards,
> Constantine.

the "parfor" construct also exists in Octave but it is only there for 
the code will be actually be executed serially.

You can obtain behaviour similar to "parfor" using "parcellfun" from the 
"parallel" package.


reply via email to

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