diff --git a/doc/manual/source/running-dynare.rst b/doc/manual/source/running-dynare.rst index 9b1c23fd6dd2ad5d7c95b48f7c1c2b0918a8d00e..585c6d4bc5cc111ca0cc7c3d5b2960929d6697cd 100644 --- a/doc/manual/source/running-dynare.rst +++ b/doc/manual/source/running-dynare.rst @@ -408,9 +408,11 @@ by the ``dynare`` command. .. option:: fast - Only useful with model option :opt:`use_dll`. Don’t recompile the - MEX files when running again the same model file and the lists - of variables and the equations haven’t changed. We use a 32 + Don’t rewrite the output files otherwise written to the disk by the preprocessor + when re-running the same model file while the lists of variables and the equations + haven’t changed. Note that the whole model still needs to be preprocessed. This option + is most useful with model option :opt:`use_dll`, because + the time-consuming compilation of the MEX files will be skipped. We use a 32 bit checksum, stored in ``<model filename>/checksum``. There is a very small probability that the preprocessor misses a change in the model. In case of doubt, re-run without the fast diff --git a/matlab/dynare.m b/matlab/dynare.m index 2839ae1d5e33e6d9f42494a08b1007af7427a5cd..b57ebf83ce4d8dd0977f4064c60a5a159a713438 100644 --- a/matlab/dynare.m +++ b/matlab/dynare.m @@ -180,6 +180,7 @@ preprocessoroutput = ~ismember('nopreprocessoroutput', varargin) && ... nolog = ismember('nolog', varargin) || ismember('nolog', file_opts); onlymacro = ismember('onlymacro', varargin) || ismember('onlymacro', file_opts); onlyjson = ismember('onlyjson', varargin) || ismember('onlyjson', file_opts); +fast = ismember('fast', varargin) || ismember('fast', file_opts); % Start journal diary off @@ -222,11 +223,13 @@ end % On MATLAB+Windows, the +folder may be locked by MATLAB, preventing its % removal by the preprocessor. % Trying to delete it here will actually fail, but surprisingly this allows -% the preprocessor to actually remove the folder (see ModFile::writeOutputFiles()) +% the preprocessor to actually remove the folder (see ModFile::writeMOutput()) % For an instance of this bug, see: % https://forum.dynare.org/t/issue-with-dynare-preprocessor-4-6-1/15448/1 -if ispc && ~isoctave && exist(['+',fname(1:end-4)],'dir') - [~,~]=rmdir(['+', fname(1:end-4)],'s'); +if ~fast + if ispc && ~isoctave && exist(['+',fname(1:end-4)],'dir') + [~,~]=rmdir(['+', fname(1:end-4)],'s'); + end end % Under Windows, make sure the MEX file is unloaded (in the use_dll case),