Skip to content
Snippets Groups Projects
Commit c11e168f authored by Marco Ratto's avatar Marco Ratto
Browse files

fixed bug with seeds in hybrid matlab-octave parallel clusters

manual cherry-pick from Commit:09bc0a0a
parent d49a7d35
Branches
Tags
1 merge request!3564.3ç cherry picked parallel fixes
......@@ -370,6 +370,7 @@ options_.mh_autocorrelation_function_size = 30;
options_.plot_priors = 1;
options_.cova_compute = 1;
options_.parallel = 0;
options_.parallel_info.isHybridMatlabOctave = false;
options_.parallel_info.leaveSlaveOpen = 0;
options_.parallel_info.RemoteTmpFolder = '';
options_.number_of_grid_points_for_kde = 2^9;
......
......@@ -45,6 +45,7 @@ end
global options_
isHybridMatlabOctave = false;
for j=1:length(options_.parallel),
if isempty(options_.parallel(j).MatlabOctavePath),
if exist('OCTAVE_VERSION')
......@@ -57,8 +58,14 @@ for j=1:length(options_.parallel),
dynareroot = strrep(which('dynare'),'dynare.m','');
options_.parallel(j).DynarePath=dynareroot;
end
isHybridMatlabOctave = isHybridMatlabOctave || any(regexpi([options_.parallel(j).MatlabOctavePath], 'octave'));
end
isHybridMatlabOctave = isHybridMatlabOctave && ~exist('OCTAVE_VERSION');
options_.parallel_info.isHybridMatlabOctave = isHybridMatlabOctave;
if isHybridMatlabOctave,
% Reset dynare random generator and seed.
set_dynare_seed('default');
end
......
......@@ -24,7 +24,7 @@ if ~nargin
error('set_dynare_seed:: I need at least one input argument!')
end
matlab_random_streams = ~(exist('OCTAVE_VERSION') || matlab_ver_less_than('7.7'));
matlab_random_streams = ~(exist('OCTAVE_VERSION') || matlab_ver_less_than('7.7') || options_.parallel_info.isHybridMatlabOctave);
if matlab_random_streams% Use new matlab interface.
if nargin==1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment