'onlymacro' option

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

'onlymacro' option

Postby pawel » Mon Sep 30, 2013 3:53 pm

Hi There

I'm using dynare (4.3.3) with option 'onlymacro' but it doesn't seem to do what the manual suggests - i.e. rather than stopping after macro-processing, it continues to launch steady state computation, run stoch_simul, plot charts etc. (the 'savemacro' and 'nolinemacro' do work fine for me, btw.).

So just wondering whether I'm being thick and this is indeed what should happen, or whether there's something funny going on with the implementation (of course, both could be true simultaneously...).

Thanks in advance for any help,
Pawel
pawel
 
Posts: 33
Joined: Fri Jan 05, 2007 11:16 am

Re: 'onlymacro' option

Postby jpfeifer » Mon Sep 30, 2013 6:25 pm

Seems to be a bug. We will keep you updated. Thanks for reporting.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: 'onlymacro' option

Postby jpfeifer » Tue Oct 01, 2013 1:15 pm

The behavior will change to the desired one starting with tomorrows snapshot.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: 'onlymacro' option

Postby HoutanBastani » Tue Oct 01, 2013 1:16 pm

The bug was fixed.

What was being run was a version of modfilename.m that had been created by a previous run of dynare. Just delete this file, run dynare with onlymacro, and processing will stop. You won't need to do this step in the next release of Dynare. Thanks for reporting this bug.
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: 'onlymacro' option

Postby pawel » Tue Oct 01, 2013 3:07 pm

Thanks a lot for your help Guys - much appreciated.

Houtan - is what you're describing meant to run with the plain vanilla v.4.3.3 or with the latest snapshot? Because if it's the former, then it doesn't do the trick for me - i.e. when I delete the .m file and re-run with option onlymacro I get an
Code: Select all
??? Error using ==> evalin
Undefined function or variable 'xxx'.
and more generally a new .m file is not created.

Either way, I've found a workaround to achieve what I wanted using savemacro and nolinemacro, so I can definitely wait till the next release for this to be 100%.

Thanks again
Pawel
pawel
 
Posts: 33
Joined: Fri Jan 05, 2007 11:16 am

Re: 'onlymacro' option

Postby HoutanBastani » Tue Oct 01, 2013 3:21 pm

It runs with 4.3.3. If you use the onlymacro command, the preprocessor will not run completely and hence the .m file will not be created. The evalin command is where dynare.m calls the modfilename.m file that is usually created by the preprocessor. As you have passed the onlymacro command, you don't want this .m file because you only want to run the macroprocessor. The bug was that we were allowing processing to continue on the matlab end (not the C++ end, in which the preprocessor is coded). This was not a problem when the .m file didn't exist in the directory, because you'd get the error you see now. But it was a problem in the case when someone had successfully run the preprocessor before.

As Johannes said, the correction will be in tomorrow's snapshot.
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: 'onlymacro' option

Postby pawel » Tue Oct 01, 2013 4:48 pm

In which case, I seem not to get what the option is meant to do...

So just to be clear: I have a xxx.mod file that uses the macro-processing language. Having read the manual, my understanding was that after running dynare xxx.mod onlymacro what I would end up with is either a new xxx.mod file in which all macro-processing commands have been parsed out, or a xxx.m file, corresponding to the parsed / macro-processed xxx.mod file. In the latter case, the xxx.m file would not be ran as everything would stop post macro-processing (though presumably, I should be able to do run it later - either by calling dynare on the post-processed .mod file or by directly invoking the .m file, in each of the two cases respectively).

Your answer seems to suggest you'd expect neither of those, right? So what is it that should happen?

Thanks again
Pawel

ps. Strictly speaking I guess I shouldn't be confusing macro-processing - i.e. replacing macro-processor commands with whatever text they represent, with parsing, i.e. converting the .mod file into an .m file (again if my understanding is correct). In which case I'd probably expect to see a new .mod file without any macro-processing instructions... But again, that was one of the two cases above, so the question still stands, I think.
pawel
 
Posts: 33
Joined: Fri Jan 05, 2007 11:16 am

Re: 'onlymacro' option

Postby HoutanBastani » Tue Oct 01, 2013 4:57 pm

The manual states:

Instructs the preprocessor to only perform the macro-processing step, and stop just after. Mainly useful for debugging purposes or for using the macro-processor independently of the rest of Dynare toolbox.


So, processing stops after the macroprocessor runs. For the .m file to be created, you need the preprocessor to finish running. So, your second case would not happen. Your first case would happen if you called dynare xxx.mod onlymacro savemacro.
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: 'onlymacro' option

Postby pawel » Tue Oct 01, 2013 5:01 pm

Gotcha and it does do exactly what it says on the tin...

Thanks!
p
pawel
 
Posts: 33
Joined: Fri Jan 05, 2007 11:16 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests