Errors while running westeros #419
-
Hi
|
Beta Was this translation helpful? Give feedback.
Replies: 11 comments
-
Moreover, in addition I faced this error while running scenario.solve() in westeros tutorial example:CalledProcessError Traceback (most recent call last) e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\core.py in solve(self, model, solve_options, **kwargs) **e:\users\zsalimian\documents\github\main\ixmp\ixmp\core.py in solve(self, model, callback, cb_kwargs, model_options) e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\models.py in run(self, scenario) e:\users\zsalimian\documents\github\main\ixmp\ixmp\model\gams.py in run(self, scenario) e:\users\zsalimian\appdata\local\programs\python\python38\lib\subprocess.py in check_call(*popenargs, **kwargs) CalledProcessError: Command 'gams "e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\MESSAGE_run.gms" --in="e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\data\MsgData_Westeros_Electrified_baseline.gdx" --out="e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\output\MsgOutput_Westeros_Electrified_baseline.gdx" --iter="e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\output\MsgIterationReport_Westeros_Electrified_baseline.gdx" LogOption=4' returned non-zero exit status 2. |
Beta Was this translation helpful? Give feedback.
-
Last error happened while running scenario.var('OBJ')['lvl']RuntimeError Traceback (most recent call last) e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\core.py in var(self, name, filters) e:\users\zsalimian\documents\github\main\ixmp\ixmp\core.py in var(self, name, filters, **kwargs) e:\users\zsalimian\documents\github\main\ixmp\ixmp\core.py in _backend(self, method, *args, **kwargs) e:\users\zsalimian\documents\github\main\ixmp\ixmp\backend\base.py in call(self, obj, method, *args, **kwargs) e:\users\zsalimian\documents\github\main\ixmp\ixmp\backend\jdbc.py in item_get_elements(self, s, type, name, filters) e:\users\zsalimian\documents\github\main\ixmp\ixmp\backend\jdbc.py in _get_item(self, s, ix_type, name, load) e:\users\zsalimian\documents\github\main\ixmp\ixmp\backend\jdbc.py in _raise_jexception(exc, msg) RuntimeError: unhandled Java exception: There exists no variable 'OBJ'! |
Beta Was this translation helpful? Give feedback.
-
As with #416, the key thing is to read the documentation. Here is the documentation for
Seeing this error indicates you are not running the notebook cells one-by-one starting from a fresh Jupyter kernel and clean scenario, but rather that you have already called The documentation page on prequisite knowledge & skills includes (emphasis added):
The other errors, like in your second comment, likely also occur because you tried to run cells without successfully running the preceding cells. For instance, if the scenario has not been solved successfully, then Please close this issue once you've managed to run the tutorial. |
Beta Was this translation helpful? Give feedback.
-
Dear Sir, But Unfortunately, I still see the following error: e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\core.py in solve(self, model, solve_options, **kwargs) e:\users\zsalimian\documents\github\main\ixmp\ixmp\core.py in solve(self, model, callback, cb_kwargs, **model_options) e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\models.py in run(self, scenario) e:\users\zsalimian\documents\github\main\ixmp\ixmp\model\gams.py in run(self, scenario) e:\users\zsalimian\appdata\local\programs\python\python38\lib\subprocess.py in check_call(*popenargs, **kwargs) CalledProcessError: Command 'gams "e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\MESSAGE_run.gms" --in="e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\data\MsgData_Westeros_Electrified_baseline.gdx" --out="e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\output\MsgOutput_Westeros_Electrified_baseline.gdx" --iter="e:\users\zsalimian\documents\github\main\message_ix#install-from-source-advanced-users\message_ix\model\output\MsgIterationReport_Westeros_Electrified_baseline.gdx" LogOption=4' returned non-zero exit status 2. |
Beta Was this translation helpful? Give feedback.
-
I guess that may be I should introduce solve_options such as CPLEX to the super().solve(model=model, solve_options=solve_options, **kwargs) in core.py. |
Beta Was this translation helpful? Give feedback.
-
This will not affect the cause of the error message you reported. I suspect you re-started/re-ran the notebook.
Again, to be clear, you do not need to edit core.py or run it directly. It is possible to pass solve_options when solving the model, but that is not necessary to run the tutorials.
Exit status 2 from GAMS indicates a compilation error: https://www.gams.com/latest/docs/UG_GAMSReturnCodes.html#UG_GAMSReturnCodes_ListOfErrorCodes Is this a version of the GAMS file you have edited? If so, how? Can you attach the MESSAGE_run.lst file? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@vahabmokari yours is not a "similar problem." The way to tell: the Please:
|
Beta Was this translation helpful? Give feedback.
-
Hi @khaeru, I also encountered I checked the GAMS link you attached above, which says it's a licensing error. However, I can indeed run the other demo "westeros". Also if I run the model with a horizon of 2010 to 2040, it worked. So I assume the maximum period that a free GAMS licenses (GAMS 29) allows is four periods (also I saw in the MESSAGEix doc that the free demon license only permit small models. Am I correct? |
Beta Was this translation helpful? Give feedback.
-
@panday1995 that's roughly correct. GAMS solvers for linear programs (LPs) are limited/licensed based on “problem size”. In the standard LP formulation, the decision variable x is a vector, and the limit is on the size, call it Nx, of this vector, e.g. Nx ≤ 1000. The MESSAGE GAMS code, once translated by GAMS into a standard LP, has an Nx that depends on the number of technologies, nodes, years, etc. Increasing the number of elements in any set will increase Nx. So it is not true that the ‘year” set, specifically, must have ≤ 4 elements. Instead: in that particular model Nx < 1000 when there are 4 periods, and Nx > 1000 (or whatever threshold for the free license) when there are 5 periods. In a different, smaller model, e.g. Westeros, perhaps Nx ≤ 1000 even with 5 or more periods, so it could be solved with the free license. Finally, thanks for looking through existing issues. As you found, even though So, just as I asked @\vahabmokari above, please in the future file a new issue instead of commenting on an unrelated one. |
Beta Was this translation helpful? Give feedback.
As with #416, the key thing is to read the documentation. Here is the documentation for
add_horizon()
, the function you are calling. In particular:Seeing this error indicates you are not running the notebook cells one-by-one starting from a fresh Jupyter kernel and clean scenario, but rather that you have already called
add_horizon()
at least once on this Scenario object. The tutorial code works if you run each cell, once, in order. If you make a mistake, you should try to restart the kernel.The documentation page on prequisite knowledge & …