Commit 05821a7c authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Change debug mode (yes|no) to debug level 0, 1 or 2

Default is zero, can be changed via command line parameter --debug=[0|1|2].
parent 32a64126
......@@ -14,7 +14,7 @@ solvelink = %Solvelink.Loadlibrary% // Solvelink controls how the problem is pa
threads = -1 // How many cores the solver can use: 0 = all cores; negative values = all cores - n
$ifi not '%debug%' == 'yes'
$ife not %debug%>1
solprint = Silent // Controls solution file outputs - debug mode will be more verbose
;
......@@ -33,10 +33,11 @@ Created by:
GAMS command line arguments
--debug=[yes|no]
Switch on/off debugging mode. In debug mode, writes debug.gdx
with all symbols as well as a gdx file for each solution containing
model parameters, variables and equations.
--debug=[0|1|2]
Set level of debugging information. Default is 0 when no extra information is
saved or displayded. At level 1, file 'debug.gdx' containing all GAMS symbols
is written at the end of execution. At level 2, debug information is written
for each solve separately.
--diag=[yes|no]
Switch on/off diagnostics. Writes some additional diagnostic results in
......@@ -66,6 +67,9 @@ References
==========================================================================
$offtext
* Set default debugging level
$if not set debug $setglobal debug 0
* Default values for input and output dir
$if not set input_dir $setglobal input_dir 'input'
$if not set output_dir $setglobal output_dir 'output'
......@@ -129,7 +133,7 @@ $iftheni.dummy not %dummy% == 'yes'
$$include 'inc/3f_afterSolve.gms' // Post-processing variables after the solve
$$include 'inc/4a_outputVariant.gms' // Store results from the loop
$endif.dummy
$iftheni.debug '%debug%' == 'yes'
$ifthene.debug %debug%>1
putclose gdx;
put_utility 'gdxout' / '%output_dir%/' mSolve.tl:0 '-' tSolve.tl:0 '.gdx';
execute_unload
......@@ -155,7 +159,7 @@ execute_unload '%output_dir%/results.gdx',
$$include 'defOutput/resultSymbols.inc'
;
$ifi '%debug%' == 'yes'
$ife %debug%>0
execute_unload '%output_dir%/debug.gdx';
if(errorcount > 0, abort errorcount);
......
......@@ -15,6 +15,9 @@ All notable changes to this project will be documented in this file.
### Changed
- Automatic calculation of parameter `dt_circular` takes into account time steps
only from `t000001` onwards.
- Debug mode yes/no changed to debug levels 0, 1 or 2. With higher level produces
more information. Default is 0, when no extra files are written (not even *debug.gdx*).
Set debug level with command line parameter `--debug=LEVEL`.
### Fixed
- Calculation of parameter `df_central`
......
......@@ -20,7 +20,7 @@ $offtext
* =============================================================================
// This is only done if debug mode is not specifically enabled
$iftheni.debug NOT '%debug%' == 'yes'
$ifthene.debug not %debug%>0
* --- Variables ---------------------------------------------------------------
......
......@@ -12,7 +12,7 @@ ScenRedParms('scen_red') = 1; // Reduce scenarios
ScenRedParms('tree_con') = 0; // No tree construction
*ScenRedParms('report_level') = 2;
ScenRedParms('run_time_limit') = 30;
$ifthen %debug% == 'yes'
$ifthene %debug%>1
ScenRedParms('visual_init') = 1;
ScenRedParms('visual_red') = 1;
$endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment