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

fixed bug with seeds in hybrid matlab-octave parallel clusters

parent fe0054f3
No related branches found
No related tags found
No related merge requests found
...@@ -392,6 +392,7 @@ options_.mh_autocorrelation_function_size = 30; ...@@ -392,6 +392,7 @@ options_.mh_autocorrelation_function_size = 30;
options_.plot_priors = 1; options_.plot_priors = 1;
options_.cova_compute = 1; options_.cova_compute = 1;
options_.parallel = 0; options_.parallel = 0;
options_.parallel_info.isHybridMatlabOctave = false;
options_.parallel_info.leaveSlaveOpen = 0; options_.parallel_info.leaveSlaveOpen = 0;
options_.parallel_info.RemoteTmpFolder = ''; options_.parallel_info.RemoteTmpFolder = '';
options_.number_of_grid_points_for_kde = 2^9; options_.number_of_grid_points_for_kde = 2^9;
......
...@@ -45,6 +45,7 @@ end ...@@ -45,6 +45,7 @@ end
global options_ global options_
isHybridMatlabOctave = false;
for j=1:length(options_.parallel), for j=1:length(options_.parallel),
if isempty(options_.parallel(j).MatlabOctavePath), if isempty(options_.parallel(j).MatlabOctavePath),
if exist('OCTAVE_VERSION') if exist('OCTAVE_VERSION')
...@@ -57,6 +58,13 @@ for j=1:length(options_.parallel), ...@@ -57,6 +58,13 @@ for j=1:length(options_.parallel),
dynareroot = strrep(which('dynare'),'dynare.m',''); dynareroot = strrep(which('dynare'),'dynare.m','');
options_.parallel(j).DynarePath=dynareroot; options_.parallel(j).DynarePath=dynareroot;
end 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 end
......
...@@ -24,7 +24,7 @@ if ~nargin ...@@ -24,7 +24,7 @@ if ~nargin
error('set_dynare_seed:: I need at least one input argument!') error('set_dynare_seed:: I need at least one input argument!')
end 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 matlab_random_streams% Use new matlab interface.
if nargin==1 if nargin==1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment