Debugger

questions about GAMS' tools
Post Reply
richard
User
User
Posts: 22
Joined: 3 months ago

Debugger

Post by richard » 1 month ago

Hi all

Is there any debugging tools in GAMS ?( like debugger tools in other software, e.g MATLAB)

Best
Richard

User avatar
bussieck
Moderator
Moderator
Posts: 208
Joined: 2 years ago

Re: Debugger

Post by bussieck » 1 month ago

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

richard
User
User
Posts: 22
Joined: 3 months ago

Re: Debugger

Post by richard » 1 month ago

Hi :-) Michael , thanks a lot ! It's helpful.

TrentRay
User
User
Posts: 1
Joined: 3 weeks ago

Re: Debugger

Post by TrentRay » 2 weeks ago

Hi Michale, does your debugging method work on no matter how complex or simple the model is?

User avatar
bussieck
Moderator
Moderator
Posts: 208
Joined: 2 years ago

Re: Debugger

Post by bussieck » 2 weeks ago

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

Post Reply