Kenneth,
I suggest you start by using a model with a generic GDX interface, not the matout stuff that is specific to GDXMRW. There are several reasons for doing this, detailed at
http://support.gams-software.com/doku.php?id=matlab_and_gams:interfacing_optimization_and_visualization_software_via_the_gdxmrw_utilities#how_can_i_construct_an_interface_between_gams_and_matlab
In this case, using a generic GDX interface will allow you to find out which parameter is taking so much time to read into Matlab and to experiment with better ways to read it. Also, it would allow you to send a big GDX file containing only the solution, a few lines of Matlab code, and the simple question “reading data XXX is taking a long time. Any ideas why and suggestions for improvement?”
HTH,
Steve
On Sat, May 31, 2014 at 3:44 AM, Kenneth Van den Bergh wrote:
Dear all,
In attachment you find a simple version of the model I’m using. It is a power plant scheduling model, formulated as a mixed-integer linear program.
As you can see, I use the GDXMRW MATLAB GAMS coupling.
The problem in attachment is a simplified one (only 3 power plants and 4 timesteps). For more advanced models with larger sets and more constraints imposed to the model, the input gdx-file becomes about 3 MB and the output gdx-file about 7,5 MB. Reading the output gdx file in matlab takes about 4 minutes for a 7,5 MB gdx file, which makes it the most time consuming step in the whole optimization. How can I speed this up?
Kind regards,
Kenneth
On Friday, May 30, 2014 9:31:27 PM UTC+2, Steven Dirkse wrote:
Kenneth,
You ask about tips to speed up the data transfer, but you have told us essentially nothing about how you are doing the transfer currently. How would anyone help you with so little information?
The GDX file is not so large: 7.5MB. I suggest you cobble up a very small Matlab m-script that shows how you are reading the GDX file now - enough to reproduce the issue, but no more - and put that, together with the GDX file, on the Web somewhere so interested folks can have a look.
-Steve
On Fri, May 30, 2014 at 12:19 PM, Kenneth Van den Bergh wrote:
Hi all,
I’m using the GDXMRW MATLAB-GAMS interface, which is working fine. However, when I run a large model, the data transfer between MATLAB-GAMS becomes rather time consuming.
My GAMS file write its output in a gdx file of 7.5 MB, which takes MATLAB about 4 minutes to read it through the rgdx utility. This it about the same as the optimization time of GAMS.
Any tips to speed up the GAMS-MATLAB data transfer?
Kind regards,
Kenneth
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdi...@gams.com
http://www.gams.com
Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com