diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m index 07c4465d884d9f2af9b7570e081eea47cc9f4a91..f5a01d4189e8ac5f560607e7afffa06f479717ea 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 85521e2047b9847eff6f8fc6979728be4db8d61a..07ae890cef133b673639438b9606261ba151d325 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 e280383940d2394f9cd4db5832354c6ee6b3a114..2c08d9ff7ae846939e4ffbd155ecc746f56b4e51 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 f884ad6f1d99a19f77177292e88ae0bfb1e019fe..450d7ced14ee7dbcc40a11378ba190cfaf179ceb 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 a6fd7176c97f5a427a0a1ea902d02b1921107b18..e15d544460252f133520d84cafa577d45d87f5e9 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 b0a6e8468cd2422831662a9a5f8755addd53612d..bcfa94c01693efe55387e2f860aab7f35ba8a8a2 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 28eb9da078bdfe6c191cfd0d8397d4f72a504ef8..066f4ad18f4c3427cf728e4916cac51a1f9bb7c8 100644 --- a/mex/sources/simulate/SparseMatrix.hh +++ b/mex/sources/bytecode/SparseMatrix.hh @@ -26,11 +26,11 @@ #include <map> #include <ctime> #include "Mem_Mngr.hh" -#ifdef NO_OPENMP +/*#ifdef NO_OPENMP // Nothing to single thread version. #else #include <omp.h> -#endif +#endif*/ #ifdef _MSC_VER #include <limits> #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 e40a49c8de3286fa6db2e2fc37b930355298713c..84e211e371bc8a18d299b7675eec524229d07824 100644 --- a/mex/sources/simulate/simulate.cc +++ b/mex/sources/bytecode/bytecode.cc @@ -24,7 +24,7 @@ //////////////////////////////////////////////////////////////////////// #include <cstring> -#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 b5c841e61b03d53eaf5eecec52a3c5db94a9337c..75fc41bb26903bfe1e806bc2474a9a8d3181051b 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)<options_.periods)" << endl - << " if ~isfield(options_,'datafile')" << endl - << " make_y_;" << endl - << " make_ex_;" << endl - << " else" << endl - << " read_data_;" << endl - << " end" << endl - << "end" << endl; - if (byte_code) - output << "oo_.endo_simul=simulate;" << endl; - else - output << basename << "_dynamic;" << endl; - output << "dyn2vec;" << endl; - } + output << "simul(oo_.dr);\n"; } StochSimulStatement::StochSimulStatement(const SymbolList &symbol_list_arg, diff --git a/preprocessor/DynamicModel.hh b/preprocessor/DynamicModel.hh index 92bd8171263d89058619718926f3d8b659726d64..9ddbada8cec7d7429029ed95761b597b0ca9818e 100644 --- a/preprocessor/DynamicModel.hh +++ b/preprocessor/DynamicModel.hh @@ -143,7 +143,7 @@ public: virtual NodeID AddVariable(const string &name, int lag = 0); //! Absolute value under which a number is considered to be zero double cutoff; - //! The weight of the Markowitz criteria to determine the pivot in the linear solver (simul_NG1 and simul_NG from simulate.cc) + //! The weight of the Markowitz criteria to determine the pivot in the linear solver (simul_NG1 and simul_NG from bytecode.cc) double markowitz; //! Compute the minimum feedback set in the dynamic model: /*! 0 : all endogenous variables are considered as feedback variables