Quantcast

octave going parallel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

octave going parallel

esche

Hello,

Has anyone experience in doing parallel application with  octave? As I have 32 threads available in Linux it is poor seeing octave just using one core! I used parcellfun already and it seems to work fine, my question would be, what will happen if I use parcellfun in a function and call this function in a  pararrayfun.

ss=[array]

tt=pararray(32,@calculate,ss);


calculate is a function like


function[tt]=calculate(matrix,varargin)

do some code    

do more code

then call

pattern = parcellfun (30, @findpattern,sliced_matrix);

do more code

even more code

endfunction

Is this going to work??

What is going to happen when a parfunction calls a parfunction ??

cheers chris


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: octave going parallel

Olaf Till-2
On Thu, Apr 06, 2017 at 07:19:22PM +0200, christoph wrote:

> Hello,
>
> Has anyone experience in doing parallel application with  octave? As I have
> 32 threads available in Linux it is poor seeing octave just using one core!
> I used parcellfun already and it seems to work fine, my question would be,
> what will happen if I use parcellfun in a function and call this function in
> a  pararrayfun.
>
> ss=[array]
>
> tt=pararray(32,@calculate,ss);
>
>
> *calculate* is a function like
>
>
> function[tt]=calculate(matrix,varargin)
>
> do some code
>
> do more code
>
> then call
>
> pattern = parcellfun (30, @findpattern,sliced_matrix);
>
> do more code
>
> even more code
>
> endfunction
>
> Is this going to work??
>
> What is going to happen when a parfunction calls a parfunction ??
It should work. But your example may generate up to 960 computing
child processes, which the kernel has to schedule to your 32 cores. If
you still get a speedup depends on your code and your machine and has
to be tested.

Note that Octave may internally parallelize certain steps of
computation even without being told so.

Olaf

--
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave

signature.asc (836 bytes) Download Attachment
Loading...