Commit 1bac2d34 authored by MichelJuillard's avatar MichelJuillard
Browse files

adding a trap to catch the case where the random generator of the

master is not available on the slave
parent f77b101d
......@@ -101,6 +101,16 @@ jloop=0;
for b = fblck:nblck,
jloop=jloop+1;
try
% this will not work if the master uses a random generator not
% available in the slave (different Matlab version or
% Matlab/Octave cluster). Therefor the trap.
set_dynare_seed(options_.DynareRandomStreams.algo);
set_dynare_random_generator_state(record.Seeds(b).Unifor, ...
record.Seeds(b).Normal);
catch
set_dynare_seed(options_.DynareRandomStreams.seed+b);
end
set_dynare_random_generator_state(record.Seeds(b).Unifor,record.Seeds(b).Normal);
if (options_.load_mh_file~=0) && (fline(b)>1) && OpenOldFile(b)
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
......
......@@ -135,8 +135,16 @@ jloop=0;
JSUM = 0;
for b = fblck:nblck,
jloop=jloop+1;
set_dynare_random_generator_state(record.Seeds(b).Unifor, ...
record.Seeds(b).Normal);
try
% this will not work if the master uses a random generator not
% available in the slave (different Matlab version or
% Matlab/Octave cluster). Therefor the trap.
set_dynare_seed(options_.DynareRandomStreams.algo);
set_dynare_random_generator_state(record.Seeds(b).Unifor, ...
record.Seeds(b).Normal);
catch
set_dynare_seed(options_.DynareRandomStreams.seed+b);
end
if (options_.load_mh_file~=0) && (fline(b)>1) && OpenOldFile(b)
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
'_blck' int2str(b) '.mat'])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment