fixed bug with seeds in hybrid matlab-octave parallel clusters

time-shift
Marco Ratto 2013-04-05 17:23:00 +02:00
parent fe0054f370
commit 09bc0a0aaa
3 changed files with 10 additions and 1 deletions

View File

@ -392,6 +392,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;

View File

@ -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,6 +58,13 @@ 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

View File

@ -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