I am trying to call GAMS within a parfor loop to perform concurrent optimizations on multiple independent datasets. The optimization routine is the same for all datasets (calls the same GAMS IDE file) and the format of the data input and output is the same for all datasets. The results of each of the GAMS runs is passed back to Matlab where I store it. I am running into an issue where all the workers are quickly "aborting" during execution of the loop.
After reading a bit about how Matlab transfers data to GAMS, I know that it creates a .gdx file for the input data and then a different .gdx file for the requested output, and it always gives these files the same name. The .gdx files appear in the same folder as the Matlab script I am running. So maybe the issue is that each of the workers is trying to write data to the same .gdx file? Either that or the workers can't see the .gdx files on the disk because they can't see the path to those files?
I know that you can write/read and name your own .gdx files with w/rgdx, but I will be running the optimization hundreds of thousands of times, so giving each optimization uniquely named .gdx files seems unwieldy. Also, each optimization routine has many hundreds of constraints (it's time series data) that will produce very large matrices. These would be difficult to construct by hand to feed to Matlab's internal optimization solvers (that's why I'm using GAMS to do it for me).
Any thoughts?

댓글 수: 2

Meiyour
Meiyour 2015년 8월 25일
I'm having the same problem. Can anyone help?
mangoon
mangoon 2017년 1월 19일
Not sure whether you still need an answer on that, but maybe others come across this post. I would suggest www.gamsoptimization.com.
You wrote: "and it always gives these files the same name". The GDX file that brings data to GAMS and the GDX file that reports data after the GAMS execution can be named differently, also if everything is controlled by Matlab. Check out the link above to see how that works.
Best!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

태그

질문:

2015년 8월 8일

댓글:

2017년 1월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by