Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return code "continue" received from GAMS via socket communication is typecasted to int without assert #13

Open
grecht opened this issue Dec 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@grecht
Copy link

grecht commented Dec 2, 2024

See title. This has led to an issue for which I do not know the reason. Presumably there is some issue with the set records.

Traceback (most recent call last):
  File "/scratch/ws/m1/rech_ge-esom-reactive/esom-reactive/src/run_acq_sequentially.py", line 224, in <module>
    main()
  File "/scratch/ws/m1/rech_ge-esom-reactive/esom-reactive/src/run_acq_sequentially.py", line 215, in main
    run_snapshot(mi, t, dir, gams_options, solver_options_ipopt)
  File "/scratch/ws/m1/rech_ge-esom-reactive/esom-reactive/src/run_acq_sequentially.py", line 130, in run_snapshot
    ct_t, problem, objective = build.build_ac(ct_t, mi_t)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/ws/m1/rech_ge-esom-reactive/metis/metis/build.py", line 340, in build_ac
    _build_core(ct, mi, reactive_power=True)
  File "/scratch/ws/m1/rech_ge-esom-reactive/metis/metis/build.py", line 436, in _build_core
    common.sets(ct, mi)
  File "/scratch/ws/m1/rech_ge-esom-reactive/metis/metis/model/common.py", line 6, in sets
    ct.addSet("T", description="snapshots", records=mi.snapshots)
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_container.py", line 871, in addSet
    return gp.Set(
           ^^^^^^^
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_symbols/set.py", line 652, in __init__
    self.setRecords(records, uels_on_axes=uels_on_axes)
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_symbols/set.py", line 792, in setRecords
    self.container._synch_with_gams(gams_to_gamspy=self._is_miro_input)
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_container.py", line 516, in _synch_with_gams
    summary = runner.run(relaxed_domain_mapping, gams_to_gamspy)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_backend/local.py", line 82, in run
    self.execute_gams(gams_string, gams_to_gamspy)
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_backend/local.py", line 103, in execute_gams
    self.container._send_job(self.job_name, self.pf_file, self.output)
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_container.py", line 365, in _send_job
    check_response(response, job_name)
  File "/lustre/exa5/home/rech_ge/miniforge3/envs/esom-reactive/lib/python3.12/site-packages/gamspy/_container.py", line 174, in check_response
    return_code = int(value)
                  ^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'continue'

@0x17
Copy link
Member

0x17 commented Dec 4, 2024

Thank your for reporting @grecht!

I haven't seen this one before. From the GAMS compilation and execution system side I can't see how the text "continue" could end up at the beginning of the socket response to gamspy. GAMS (in theory) always should send a return code number at the beginning of its response to gamspy. So from the top of my head, I struggle to come up with an explanation for what you observed. I need to investigate further together with @mabdullahsoyturk to get to the bottom of this.

Just to clarify: As the script file name run_acq_sequentially.py suggests, you are running the jobs in sequential mode in that particular case? Even if these are parallel jobs that shouldn't be a problem as it just spawns one GAMS process for each job and gives it an unique port for communication. If you have some more details when this specific problem happens, if it is always the text "continue", anything that helps us with reproducing would be appreciated.

@0x17 0x17 added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants