Skip to content

Commit

Permalink
Handle concurrent=… arg to MACRO solve()
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Jan 20, 2025
1 parent e8415a8 commit ab5cf63
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions message_ix/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,21 @@ def __init__(self, *args, **kwargs):
f"{self.name} requires GAMS >= {self.GAMS_min_version}; found {version}"
)

# Additional command-line arguments to GAMS
solve_args = []
try:
concurrent = str(kwargs.pop("concurrent"))
except KeyError:
pass
else:
if concurrent not in ("0", "1"):
raise ValueError(f"{concurrent = }")
solve_args.append(f"--MACRO_CONCURRENT={concurrent}")

super().__init__(*args, **kwargs)

self.solve_args.extend(solve_args)

@classmethod
def initialize(cls, scenario, with_data=False):
"""Initialize the model structure."""
Expand Down

0 comments on commit ab5cf63

Please sign in to comment.