Page 1 of 1

dynare_config

PostPosted: Fri Jun 27, 2014 6:50 am
by marimel
Hi ! )
Just very interesred in configuration file)
this is a part of an authentic code

Code: Select all
%% Set mex routine names
mex_status = cell(1,3);
mex_status(1,1) = {'mjdgges'};
[u]mex_status(1,2) = {'qz'};[/u]
mex_status(1,3) = {'Generalized QZ'};
mex_status(2,1) = {'gensylv'};
[u]mex_status(2,2) = {'gensylv'};[/u]
mex_status(2,3) = {'Sylvester equation solution'};
mex_status(3,1) = {'A_times_B_kronecker_C'};
[u]mex_status(3,2) = {'kronecker'};[/u]
mex_status(3,3) = {'Kronecker products'};
mex_status(4,1) = {'sparse_hessian_times_B_kronecker_C'};
[u]mex_status(4,2) = {'kronecker'};[/u]
mex_status(4,3) = {'Sparse kronecker products'};
mex_status(5,1) = {'local_state_space_iteration_2'};
[u]mex_status(5,2) = {'particle/local_state_space_iteration'};[/u]
mex_status(5,3) = {'Local state space iteration (second order)'};
number_of_mex_files = size(mex_status,1);

%% Remove some directories from matlab's path. This is necessary if the user has
 %% added dynare_v4/matlab with the subfolders. Matlab has to ignore these
 %% subfolders if valid mex files exist.
matlab_path = path;
for i=1:number_of_mex_files
    test = strfind(matlab_path,[dynareroot mex_status{i,2}]);
    action = length(test);
    if action
        rmpath([dynareroot mex_status{i,2}]);
        matlab_path = path;
    end
end


Why the cycle is organized only to check highlighted dll files? I mean what if I have other files exist both in dynareroot and as a subfolder in matlab path?
Hope it wouldn't bore for you to answer)
Thanks in advance!

Re: dynare_config

PostPosted: Fri Jun 27, 2014 8:54 am
by jpfeifer
Sorry, but I don't understand the question. We check for the presence of our prepackaged mex-files and remove some paths to avoid naming conflicts. Do you face a particular problem?

Re: dynare_config

PostPosted: Fri Jun 27, 2014 10:06 am
by marimel
Thanks for reply!
there is not a problem, everything is working, I'm just interested why this cycle is so specific, why not to check all prepackaged mex-files and remove all paths if exist? I must be wrong, but It seems strange somehow..

Re: dynare_config

PostPosted: Fri Jun 27, 2014 10:34 am
by marimel
One more question if you don't mind, cause I've just started my friendship with dynare)
what does command: (status,result)=system(command) do? [(command) - dynareroot with model file name] is it run dynare.exe or..?

Re: dynare_config

PostPosted: Fri Jun 27, 2014 11:51 am
by jpfeifer
It runs the dynare_m.exe, which is the preprocessor that creates the m-files Dynare uses.

Re: dynare_config

PostPosted: Fri Jun 27, 2014 12:10 pm
by marimel
preprocessor creates some additional m-files, and how to find them? And what about evalin('base', model_name) command, is it also run in exe file? or it is using those additional files? I mean is it possible to see the code which form the structure of M_ and oo_ and others?

Re: dynare_config

PostPosted: Fri Jun 27, 2014 1:47 pm
by jpfeifer
The files are in the folder, e.g. the _dynamic.m and _static.m. The evalin-command runs the m-file with the same name as your mod-file. If your mod-file is called mymodel.mod, the m-file is called mymodel.m.
All Dynare codes that are run are accessible via debugging in Matlab.