iiasa / iiasa/message_ix

Handling of GAMS default configuration: e.g. solprint

Open
#536 0 comments 0 reactions 0 assignees View on GitHub
docs enh
Dominant language
Jupyter Notebook
Stars
150
Forks
178
Avg merge
17h 32m
Merged PRs (30d)
2

Description

Based on the framework documentation, the GAMS options (https://www.gams.com/latest/docs/UG_GamsCall.html#UG_GamsCall_ListOfCommandLineParameters ) can be passed via the `solve()` command.

When passing `solve(gams_args=["solPrint=1"])` GAMS should print the solution in the .lst file. The log printed in the command-line window, shows that the argument is being passed to GAMS, yet it has no effect.

Why? An explanation follows:

"solPrint" is in fact "on" by default according to the GAMS-documentation. MESSAGEix suppresses this default behavior by specifying `option solprint = off` in the file `auxiliary_settings.gms`. As options specified in a configuration file are prioritized over those passed via the command-line, `solve(gams_args=["solPrint=1"])` is always overwritten by the setting in `auxiliary_settings.gms`.

This can be tested by:
1. Commenting out the line `option solprint = off` in the file `auxiliary_settings.gms`
2. Run a tutorial, and the resulting lst file will contain the solution (as expected because this is the default).
3. Re-Run the tutorial using `solve(gams_args=["solPrint=0"])` and the resulting lst file will not include the solution.

Hence, at a minimum this should be documented (option 1), better yet would be to added some of warning (option 2) or even adjust the code so that the options in `auxiliary_settings.gms` can be overwritten (option 3).

Contributor guide

Open the contributing guide

Research direction

Start with auxiliary_settings.gms and the solve() handling for gams_args. Reproduce the behavior with solPrint=1 and solPrint=0 using a tutorial, then inspect the resulting .lst files. Done means the chosen resolution—documentation, a warning, or allowing overrides—is implemented and verified against this reproduction.

Written by the indexing model from the issue text.

Assessment

Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.