|
Sebastiaan,
Unfortunately, there is currently no way of achieving this
with parfor. Out of curiosity, how many MB is the problem
data that you have?
Thanks,
Narfi
"Sebastiaan " <s.breedveld@erasmusmc.REMOVE.BOO.BOO.nl>
wrote in message <ftv8ea$19m$1@fred.mathworks.com>...
> Dear list,
>
> Is there a way to declare that a variable is shared and not
> changed during a parfor loop? A variable containing problem
> data can be pretty large. When the data is read-only, there
> is no need to copy the data to all of the workers on a
> shared memory system.
>
> Example code:
>
> data = rand(N, N); % generate some (static) problem data
> parfor j=1:N
> res = do_something(data, j);
> output(j) = res;
> end
>
> % data is unchanged
>
> Sincerely,
> Sebastiaan
|