From 9f45200924b7458f53921b9fea8652a6554a03f9 Mon Sep 17 00:00:00 2001 From: ferhat Date: Wed, 2 Sep 2009 14:40:54 +0000 Subject: [PATCH] simulate.dll has been replaced by bytecode.dll git-svn-id: https://www.dynare.org/svn/dynare/trunk@2881 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/dynare_config.m | 6 ++--- matlab/global_initialization.m | 2 +- matlab/simul.m | 26 ++++++++++++++----- matlab/steady_.m | 2 +- mex/sources/build_matlab.m | 4 +-- mex/sources/build_matlab_multithread.m | 6 ++--- .../{simulate => bytecode}/Interpreter.cc | 0 .../{simulate => bytecode}/Interpreter.hh | 0 .../{simulate => bytecode}/Mem_Mngr.cc | 0 .../{simulate => bytecode}/Mem_Mngr.hh | 0 .../{simulate => bytecode}/SparseMatrix.cc | 0 .../{simulate => bytecode}/SparseMatrix.hh | 4 +-- .../simulate.cc => bytecode/bytecode.cc} | 2 +- .../simulate.hh => bytecode/bytecode.hh} | 0 .../testing/mex_interface.cc | 0 .../testing/mex_interface.hh | 0 .../testing/simulate_debug.m | 0 preprocessor/ComputingTasks.cc | 19 +------------- preprocessor/DynamicModel.hh | 2 +- 19 files changed, 34 insertions(+), 39 deletions(-) rename mex/sources/{simulate => bytecode}/Interpreter.cc (100%) rename mex/sources/{simulate => bytecode}/Interpreter.hh (100%) rename mex/sources/{simulate => bytecode}/Mem_Mngr.cc (100%) rename mex/sources/{simulate => bytecode}/Mem_Mngr.hh (100%) rename mex/sources/{simulate => bytecode}/SparseMatrix.cc (100%) rename mex/sources/{simulate => bytecode}/SparseMatrix.hh (98%) rename mex/sources/{simulate/simulate.cc => bytecode/bytecode.cc} (99%) rename mex/sources/{simulate/simulate.hh => bytecode/bytecode.hh} (100%) rename mex/sources/{simulate => bytecode}/testing/mex_interface.cc (100%) rename mex/sources/{simulate => bytecode}/testing/mex_interface.hh (100%) rename mex/sources/{simulate => bytecode}/testing/simulate_debug.m (100%) diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m index 07c4465d8..f5a01d418 100644 --- a/matlab/dynare_config.m +++ b/matlab/dynare_config.m @@ -152,8 +152,8 @@ for i=1:number_of_mex_files disp([ message mex_status{i,3} '.' ]) end -% Test if simulate DLL is present -if exist('simulate') == 3 +% Test if bytecode DLL is present +if exist('bytecode') == 3 remove_path_to_mex = 0; if ~multithread_flag message = '[mex] '; @@ -163,7 +163,7 @@ if exist('simulate') == 3 else message = '[no] '; end -disp([ message 'Fast model evaluation.' ]) +disp([ message 'Bytecode evaluation.' ]) if remove_path_to_mex rmpath(path_to_mex_files); diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m index 85521e204..07ae890ce 100644 --- a/matlab/global_initialization.m +++ b/matlab/global_initialization.m @@ -224,7 +224,7 @@ function global_initialization() % did model undergo block decomposition + minimum feedback set computation ? options_.block = 0; - % model evaluated using simulate.dll + % model evaluated using bytecode.dll options_.bytecode = 0; % SWZ SBVAR diff --git a/matlab/simul.m b/matlab/simul.m index e28038394..2c08d9ff7 100644 --- a/matlab/simul.m +++ b/matlab/simul.m @@ -57,21 +57,33 @@ ct_=0; if options_.simul_algo == 0 if ~ options_.initval_file - make_ex_; - make_y_; + if ~isfield(options_,'datafile') + make_ex_; + make_y_; + else + read_data_; + end end - + if isempty(options_.scalv) | options_.scalv == 0 options_.scalv = oo_.steady_state ; end options_.scalv= 1 ; - if M_.maximum_endo_lag ==1 & M_.maximum_endo_lead <= 1 - sim1 ; + if(options_.block) + if(options_.bytecode) + oo_.endo_simul=bytecode('dynamic'); + else + eval([M_.fname '_dynamic']); + end; else - simk ; - end + if M_.maximum_endo_lag ==1 & M_.maximum_endo_lead <= 1 + sim1 ; + else + simk ; + end + end; else set_default_option('replic',1); set_default_option('simul_seed',1); diff --git a/matlab/steady_.m b/matlab/steady_.m index f884ad6f1..450d7ced1 100644 --- a/matlab/steady_.m +++ b/matlab/steady_.m @@ -80,7 +80,7 @@ function steady_() oo_.exo_det_steady_state], M_.params); end elseif options_.block && options_.bytecode - [oo_.steady_state,check] = simulate('steady_state'); + [oo_.steady_state,check] = bytecode('steady_state'); else [oo_.steady_state,check] = dynare_solve([M_.fname '_static'],... oo_.steady_state,... diff --git a/mex/sources/build_matlab.m b/mex/sources/build_matlab.m index a6fd7176c..e15d54446 100644 --- a/mex/sources/build_matlab.m +++ b/mex/sources/build_matlab.m @@ -135,5 +135,5 @@ eval([ COMPILE_COMMAND ' -DMATLAB -Igensylv/cc ' ... 'gensylv/cc/Vector.cpp ' ... BLAS_PATH ' ' LAPACK_PATH ]); -disp('Compiling simulate...') -eval([ COMPILE_COMMAND ' -Isimulate -I../../preprocessor simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc']); \ No newline at end of file +disp('Compiling bytecode...') +eval([ COMPILE_COMMAND ' -Ibytecode -I../../preprocessor bytecode/bytecode.cc bytecode/Interpreter.cc bytecode/Mem_Mngr.cc bytecode/SparseMatrix.cc']); \ No newline at end of file diff --git a/mex/sources/build_matlab_multithread.m b/mex/sources/build_matlab_multithread.m index b0a6e8468..bcfa94c01 100644 --- a/mex/sources/build_matlab_multithread.m +++ b/mex/sources/build_matlab_multithread.m @@ -114,7 +114,7 @@ try disp('| OpenMp is used (multithreaded mex files) for: |') disp('| * sparse_hessian_times_B_kronecker_C.cc |') disp('| * A_times_B_kronecker_C.cc |') - disp('| * simulate (SparseMatrix.cc) |') + disp('| * bytecode (SparseMatrix.cc) |') disp('|------------------------------------------------|') disp(' ') COMPILE_OPTIONS_OMP = [ COMPILE_OPTIONS CFLAGS CXXFLAGS LDFLAGS ]; @@ -161,5 +161,5 @@ eval([ COMPILE_COMMAND ' -DMATLAB -Igensylv/cc ' ... 'gensylv/cc/Vector.cpp ' ... BLAS_PATH ' ' LAPACK_PATH ]); -disp('Compiling simulate...') -eval([ COMPILE_COMMAND_OMP ' -Isimulate -I../../preprocessor simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc']); \ No newline at end of file +disp('Compiling bytecode...') +eval([ COMPILE_COMMAND_OMP ' -Ibytecode -I../../preprocessor bytecode/bytecode.cc bytecode/Interpreter.cc bytecode/Mem_Mngr.cc bytecode/SparseMatrix.cc']); \ No newline at end of file diff --git a/mex/sources/simulate/Interpreter.cc b/mex/sources/bytecode/Interpreter.cc similarity index 100% rename from mex/sources/simulate/Interpreter.cc rename to mex/sources/bytecode/Interpreter.cc diff --git a/mex/sources/simulate/Interpreter.hh b/mex/sources/bytecode/Interpreter.hh similarity index 100% rename from mex/sources/simulate/Interpreter.hh rename to mex/sources/bytecode/Interpreter.hh diff --git a/mex/sources/simulate/Mem_Mngr.cc b/mex/sources/bytecode/Mem_Mngr.cc similarity index 100% rename from mex/sources/simulate/Mem_Mngr.cc rename to mex/sources/bytecode/Mem_Mngr.cc diff --git a/mex/sources/simulate/Mem_Mngr.hh b/mex/sources/bytecode/Mem_Mngr.hh similarity index 100% rename from mex/sources/simulate/Mem_Mngr.hh rename to mex/sources/bytecode/Mem_Mngr.hh diff --git a/mex/sources/simulate/SparseMatrix.cc b/mex/sources/bytecode/SparseMatrix.cc similarity index 100% rename from mex/sources/simulate/SparseMatrix.cc rename to mex/sources/bytecode/SparseMatrix.cc diff --git a/mex/sources/simulate/SparseMatrix.hh b/mex/sources/bytecode/SparseMatrix.hh similarity index 98% rename from mex/sources/simulate/SparseMatrix.hh rename to mex/sources/bytecode/SparseMatrix.hh index 28eb9da07..066f4ad18 100644 --- a/mex/sources/simulate/SparseMatrix.hh +++ b/mex/sources/bytecode/SparseMatrix.hh @@ -26,11 +26,11 @@ #include #include #include "Mem_Mngr.hh" -#ifdef NO_OPENMP +/*#ifdef NO_OPENMP // Nothing to single thread version. #else #include -#endif +#endif*/ #ifdef _MSC_VER #include #endif diff --git a/mex/sources/simulate/simulate.cc b/mex/sources/bytecode/bytecode.cc similarity index 99% rename from mex/sources/simulate/simulate.cc rename to mex/sources/bytecode/bytecode.cc index e40a49c8d..84e211e37 100644 --- a/mex/sources/simulate/simulate.cc +++ b/mex/sources/bytecode/bytecode.cc @@ -24,7 +24,7 @@ //////////////////////////////////////////////////////////////////////// #include -#include "simulate.hh" +#include "bytecode.hh" #include "Interpreter.hh" #include "Mem_Mngr.hh" diff --git a/mex/sources/simulate/simulate.hh b/mex/sources/bytecode/bytecode.hh similarity index 100% rename from mex/sources/simulate/simulate.hh rename to mex/sources/bytecode/bytecode.hh diff --git a/mex/sources/simulate/testing/mex_interface.cc b/mex/sources/bytecode/testing/mex_interface.cc similarity index 100% rename from mex/sources/simulate/testing/mex_interface.cc rename to mex/sources/bytecode/testing/mex_interface.cc diff --git a/mex/sources/simulate/testing/mex_interface.hh b/mex/sources/bytecode/testing/mex_interface.hh similarity index 100% rename from mex/sources/simulate/testing/mex_interface.hh rename to mex/sources/bytecode/testing/mex_interface.hh diff --git a/mex/sources/simulate/testing/simulate_debug.m b/mex/sources/bytecode/testing/simulate_debug.m similarity index 100% rename from mex/sources/simulate/testing/simulate_debug.m rename to mex/sources/bytecode/testing/simulate_debug.m diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc index b5c841e61..75fc41bb2 100644 --- a/preprocessor/ComputingTasks.cc +++ b/preprocessor/ComputingTasks.cc @@ -94,24 +94,7 @@ void SimulStatement::writeOutput(ostream &output, const string &basename) const { options_list.writeOutput(output); - if (!block) - output << "simul(oo_.dr);\n"; - else - { - output << "if (~ options_.initval_file) & (size(oo_.endo_simul,2)