Page 1 of 1
Debugger
Posted: Wed Oct 24, 2018 4:41 pm
by richard
Hi all
Is there any debugging tools in GAMS ?( like debugger tools in other software, e.g MATLAB)
Best
Richard
Re: Debugger
Posted: Thu Oct 25, 2018 12:00 pm
by bussieck
There is no interactive debugger in the current version of GAMS (this is in the development pipeline for GAMS Studio). What I do when I debug a model is to use
execute_unload "alldataN.gdx"; at the points of interest in the code and analyze the GDX files after the run. You can also
pause the execution of GAMS in various ways, e.g. by running an interactive shell (
execute '';, this does not work from the IDE or Studio) or calling the
ask utility, e.g.
execute 'ask T=radiobuttons M="Just Press OK to continue" D="o1" E="1" o=nul';. So the following exports the entire GAMS database to GDX file alldata0 and alldata1 and pauses the execution before and after the solve statement:
Code: Select all
execute_unload "alldata0.gdx";
execute 'ask T=radiobuttons M="Just Press OK to continue" D="o1" E="1" o=nul';
solve transport using lp minimizing z;
execute_unload "alldata1.gdx";
execute 'ask T=radiobuttons M="Just Press OK to continue" D="o1" E="1" o=nul';
-Michael
Re: Debugger
Posted: Thu Oct 25, 2018 1:39 pm
by richard
Hi
Michael , thanks a lot ! It's helpful.
Re: Debugger
Posted: Fri Nov 23, 2018 3:25 pm
by TrentRay
Hi Michale, does your debugging method work on no matter how complex or simple the model is?
Re: Debugger
Posted: Fri Nov 23, 2018 6:54 pm
by bussieck
It's a method that's independent of many things. If you need to "debug" at too many places at once, that you need to inject the code at too many places, and therefore it becomes at some stage not very usable.
-Michael