MPSGE on a Mac: model not reading in a loop structure

Problems with modeling
Post Reply
rj235
User
User
Posts: 5
Joined: 4 years ago

MPSGE on a Mac: model not reading in a loop structure

Post by rj235 »

Hi there,

I have an MPSGE model of an economy that I can run iteratively on a Windows machine with no issue. My code basically puts together the model, solves for the benchmark equilibrium as usual, and then generates and solves for the equilibria over a set of counterfactuals via a looping structure. When I run that same code on a Mac, everything still runs and the benchmark is the same. But, I get null (i.e. benchmark, since that's where my intial values are set) solutions for my counterfactuals with the following less-than-helpful error text:

---

ERROR: <model>.NSolves out of sync with integer1
check for missing $INCLUDE <model>.GEN

---

Here is what I have done:

* I have ensured that the appropriate $INCLUDE <model>.GEN statement (in this case, "$INCLUDE IMPLAN.GEN") is indeed in my loop structure, spelled correctly, and at the start of the line.
* While it should not matter, I also have made sure that the case is consistent in my calls and across the program generally.
* I have made sure my counterfactual inputs are loading correctly.

None of this has helped. Again, the model runs fine on Windows, just not on Mac. Is there any possible issue with MPSGE on a Mac that prohibits iterating? Perhaps some other Mac environment issue? Running GAMS in the OS X environment does have it's quirks...

Thanks in advance for any help.
User avatar
dirkse
Moderator
Moderator
Posts: 214
Joined: 7 years ago
Location: Fairfax, VA

Re: MPSGE on a Mac: model not reading in a loop structure

Post by dirkse »

Hi,

I'm not aware of any issues on the Mac when it comes to running GAMS or to GAMS code that uses a loop. With MPSGE you use the filesystem more than with other GAMS runs, so it can be a headache to move from the case-insensitive Windows environment to something case-sensitive (i.e., anything but Windows). That pops up in interesting ways. It sounds though like you've tried to account for this.

If you don't have success with this I recommend you post (please attach, don't inline) a minimal example that reproduces the issue.

-Steve
rj235
User
User
Posts: 5
Joined: 4 years ago

Re: MPSGE on a Mac: model not reading in a loop structure

Post by rj235 »

I got this sorted out. After reading through the <model>.GEN file, I realized that it tracks how many times the model has been used in an $INCLUDE statement in <model>.INTEGER1. While I do not entirely understand the purpose, it seems to make sure the number of SOLVE and $INCLUDE statements align, likely to facilitate passing output from one run to the next. The error suggested that this alignment was broken somewhere, and lo and behold I found a SOLVE that was missing a $INCLUDE paired above it.

Thanks for your help.
Post Reply