Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in read_sol_from_gdx #98

Closed
OFR-IIASA opened this issue Nov 21, 2018 · 4 comments · Fixed by #500
Closed

error in read_sol_from_gdx #98

OFR-IIASA opened this issue Nov 21, 2018 · 4 comments · Fixed by #500
Assignees
Labels
backend.jdbc Interaction with ixmp_source via JDBCBackend & JPype
Milestone

Comments

@OFR-IIASA
Copy link

OFR-IIASA commented Nov 21, 2018

Another issue which I have encountered, but which I havent been able to replicate:

When a scenario has been run, an error occurs where the scenario is not checked when trying to upload the solution from the gdx file.

--- Restarting execution
--- MESSAGE-MACRO_run.gms(4794) 402 Mb
--- Reading solution for model MESSAGE_MACRO
--- MESSAGE-MACRO_run.gms(4509) 403 Mb
    +++ Convergence criteria satisfied after 8 iterations +++
--- MESSAGE-MACRO_run.gms(4941) 406 Mb
--- GDX File /h/u045sumida/fricko/.local/lib/python3.7/site-packages/message_ix/model/output/MsgOutput_MESSAGEix-GLOBIOM_BvR_OFR_noBCCS.gdx
--- MESSAGE-MACRO_run.gms(4949) 406 Mb
    +++ End of MESSAGEix-MACRO run - have a nice day! +++
*** Status: Normal completion
--- Job MESSAGE-MACRO_run.gms Stop 11/20/18 16:39:38 elapsed 0:31:26.838
2018-11-20 16:39:39,455 DEBUG at.ac.iiasa.ixmp.database.DbDAO:1744 - loading elements for set 'map_temporal_hierarchy' from database...
2018-11-20 16:39:39,461 DEBUG at.ac.iiasa.ixmp.database.DbDAO:1744 - loading elements for parameter 'duration_time' from database...
2018-11-20 16:39:39,506  INFO at.ac.iiasa.ixmp.objects.Scenario:1346 - this Scenario does not contain any elements in a Variable or Equation
--- Warning: The GAMS version [25.1.2] differs from the API version [24.8.3].
Model: MESSAGEix-GLOBIOM_BvR_OFR
Scenario: noBCCS
kwargs: {'run': ['all'], 'exclusion': {'exclusion_type': 'noBECCS'}, 'base': {'model': 'MESSAGEix-GLOBIOM_BvR_OFR', 'scenario': 'NPi2020_Net0'}}
default_kwargs: {'solve': {'model': 'MESSAGE-MACRO'}, 'macro': {'copy_demand': 'True'}, 'reporting': 'True', 'clone': {'first_model_year': 2030}, 'upload': 'True'}
Traceback (most recent call last):
  File "runMESSAGEix.py", line 155, in <module>
    run(model, scenario, kwargs, default_kwargs)
  File "runMESSAGEix.py", line 91, in run
    scen.solve(**sol_kwa)
  File "/h/u045sumida/fricko/.local/lib/python3.7/site-packages/message_ix/core.py", line 289, in solve
    return super(Scenario, self).solve(model=model, **kwargs)
  File "/h/u045sumida/fricko/.local/lib/python3.7/site-packages/ixmp/core.py", line 1006, in solve
    var_list, equ_list, check_solution)
  File "/h/u045sumida/fricko/.local/lib/python3.7/site-packages/ixmp/core.py", line 937, in read_sol_from_gdx
    check_solution)
jpype._jexception.IxExceptionPyRaisable: at.ac.iiasa.ixmp.exceptions.IxException: This Scenario is not checked out - no changes to discard!
@OFR-IIASA
Copy link
Author

OFR-IIASA commented Nov 21, 2018

@danielhuppmann so, the initial problem I was having was this. Have you ever experienced this? And the scenario solved correctly (NOTE that scenarios are running concurrently)

--- Restarting execution
--- MESSAGE-MACRO_run.gms(4795) 402 Mb
--- Reading solution for model MESSAGE_MACRO
--- MESSAGE-MACRO_run.gms(4510) 403 Mb
    +++ Convergence criteria satisfied after 8 iterations +++
--- MESSAGE-MACRO_run.gms(4942) 406 Mb
--- GDX File /h/u045sumida/fricko/.local/lib/python3.7/site-packages/message_ix/model/output/MsgOutput_MESSAGEix-GLOBIOM_BvR_OFR_noBCCS.gdx
--- MESSAGE-MACRO_run.gms(4950) 406 Mb
    +++ End of MESSAGEix-MACRO run - have a nice day! +++
*** Status: Normal completion

@danielhuppmann
Copy link
Member

The problem may be that they are running concurrently - you cannot call GAMS on the same file in parallel. You would need to duplicate the MESSAGE_run.gms file for each process and call that other file.

@OFR-IIASA
Copy link
Author

OFR-IIASA commented Nov 22, 2018

SO I believe to have identified the issue. It seems that the last MESSAGE run returned unscaled infeasibilities

Total time on 4 threads = 40.59 sec. (19565.63 ticks)
LP status(5): optimal with unscaled infeasibilities
Cplex Time: 40.60sec (det. 19567.01 ticks)

Optimal solution found, but with infeasibilities after unscaling.
Simplex iterations after crossover:  123

but then macro runs, states that " +++ Convergence criteria satisfied after 8 iterations +++" but the solution cant be read because of the infeasibilities after unscaling!

@OFR-IIASA
Copy link
Author

@danielhuppmann @gidden Assuming that my assumption above is correct, how should can this best be resolved? Should there be some check to see if the solution status of the scenario used in macro is correct?

@khaeru khaeru added the backend.jdbc Interaction with ixmp_source via JDBCBackend & JPype label Jul 15, 2020
khaeru added a commit that referenced this issue Nov 21, 2023
@khaeru khaeru added this to the 3.8 milestone Nov 21, 2023
@khaeru khaeru self-assigned this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend.jdbc Interaction with ixmp_source via JDBCBackend & JPype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants