Page 1 of 1

Loop crashes

PostPosted: Fri Oct 10, 2014 10:55 am
by petros_varth
Hi All,

I am running a very large loop in which i change some of the parameters of my model.

However, most of the times this loop crashes with the following error:

Error: Can't open file two_country_currency_union_tn_dynamic.m for writing

Error using dynare (line 114)
DYNARE: preprocessing failed

Error in welfare_star_tn (line 49)
dynare two_country_currency_union_tn noclearall;


Any hints?

Best,

P.

Re: Loop crashes

PostPosted: Fri Oct 10, 2014 11:48 am
by jpfeifer
If you only change parameters, you are not supposed to repeatedly call Dynare. Rather, run Dynare only once and then use the commands you want to run in a loop directly. See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891
Whenever you run dynare itself, you are running the preprocessor, which re-creates all files. It seems that your machine is not quick enough in writing these files so that the previous iteration was not done yet with writing the created files, leading to the crash.

Re: Loop crashes

PostPosted: Tue Oct 14, 2014 6:40 am
by hanz
I had similar problems while using Dropbox. I paused syncing and the problem was solved.

Re: Loop crashes

PostPosted: Tue Oct 14, 2014 8:26 am
by jpfeifer
Let me reiterate my point. Although e.g. Wouter Den Haan and Eric Sims say so in their Dynare notes, you should always avoid running full Dynare within a loop or optimizer. If anyhow possible, make use of the Dynare rountines without running the preprocessor over and over again. This typically requires only small effort and increases speed by several magnitudes.