Info

This question is closed. Reopen it to edit or answer.

parfor and se_randomizeseeds error

1 view (last 30 days)
Soren
Soren on 24 Sep 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I'm having trouble randomizing my GlobalSeed for a SimuLink model inside parfor with 8 workers. The same code works flawlessly if I remove the 'par' from the 'parfor'.
Code
parfor r = 1:testing_depth
%code
%
%
for i = 1:iterations
seed = mod(floor((i/iterations) * now * 8640000),2^31-1);
se_randomizeseeds(modelname, 'GlobalSeed', seed);
sim(modelname);
%code
%
%
end
end
Output (command window)
Starting parallel pool (parpool) using the 'local' profile ... connected to 8 workers.
Depth test: 4/10 (1000 iterations per depth)
Depth test: 7/10 (1000 iterations per depth)
Iterations:
Iterations:
Error using cpf_v5 (line 58)
Invalid block or system specified. Type 'se_randomizeseeds' for more information.
>> se_randomizeseeds
Error using se_randomizeseeds (line 37)
Missing block(s) or system(s) as first input argument. Type 'help se_randomizeseeds' for more information.
>>
  1 Comment
Edric Ellis
Edric Ellis on 24 Sep 2014
I don't know much about se_randomizeseeds - but does it help to say
load_system(modelname)
before you do that?

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!