help-octave
[Top][All Lists]
Advanced

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

Parallelize code


From: samuel WEBER
Subject: Parallelize code
Date: Wed, 6 Apr 2016 15:24:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

Hi,

I am doing some Monte Carlo simulations so it should be easy to parallelize.
Here is the thing : I have a A (a Nx3) matrix and another B (a 3x1) and I compute the product A*B.
However I have to change M times the B matrix with random number.
As far as I am, I create a C matrix (3xM) containing all the B matrix concatenated, and run

[y]=ndpar_arrayfun(nproc-1, @MonteCarlo, C(1,:), C(2,:), C(3,:),...
            "ChunksPerProc", 1, ...
            "VerboseLevel", 0, ...
            "IdxDimensions", [2 2 2], ...
            "UniformOutput", false );

with the ndpar package.

It works. However I have several questions :
  1. Is there a way to give a 3x1 argument to a parallel code? I have to "split" it in three 1x1 arguments...
  2. I only improve performance by 2 (with 4 core), is it normal?
  3. I need in the MonteCarlo's function other variables. I do it with "global", is there a clever way?

Thanks in advance!


reply via email to

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