Hi everyone,
I have a workflow running GAMS models using the Python 3.6 API. I am looking for a way to inspect the solver progress, the same way you would when running a GAMS job in the IDE. Is there a class or method in the Python API to enable this type of output? This will assist in debugging the model, etc.
This topic may be related to this previous topic viewtopic.php?f=10&t=9903&p=22605&hilit ... put#p22605. I also searched the Python API documentation https://www.gams.com/latest/docs/API_PY_TUTORIAL.html. Perhaps I missed the class reference. Thanks!
David
Python API: view solver output
-
- User
- Posts: 7
- Joined: 6 years ago
- Location: Tokyo, Japan
- Contact:
Python API: view solver output
David
Asia Pacific Energy Research Centre (APERC)
Asia Pacific Energy Research Centre (APERC)
Re: Python API: view solver output
David,
The GAMSJob.run method has an (optional) argument output. You pass in a stream, e.g. sys.stdout, and viola the GAMS log including the solver log appears on stdout. You can use other streams , including files to capture the log more permanently. This has been asked often enough that in the new GAMS 31 (currently in beta) we added a section to mention this explicitly: https://www.gams.com/beta/docs/API_PY_T ... PTION_FILE
-Michael
The GAMSJob.run method has an (optional) argument output. You pass in a stream, e.g. sys.stdout, and viola the GAMS log including the solver log appears on stdout. You can use other streams , including files to capture the log more permanently. This has been asked often enough that in the new GAMS 31 (currently in beta) we added a section to mention this explicitly: https://www.gams.com/beta/docs/API_PY_T ... PTION_FILE
-Michael
-
- User
- Posts: 7
- Joined: 6 years ago
- Location: Tokyo, Japan
- Contact:
Re: Python API: view solver output
Michael,
Thank you for the pointer -- the output argument worked and is very convenient!
Many thanks,
David
Thank you for the pointer -- the output argument worked and is very convenient!
Many thanks,
David
David
Asia Pacific Energy Research Centre (APERC)
Asia Pacific Energy Research Centre (APERC)