Skip to content

SSACSolver freezes until pressing Ctrl+C #960

@maurosilber

Description

@maurosilber

Hi,

I was running a simulation with the SSACSolver, and noticed that sometimes it gets stuck while reading from stdin in this line:

line = output.read(page_size).decode("ascii")

After pressing Ctrl+C, it resumes, reading and decoding some more lines. Then, it "terminates" early and throws a ValueError: read of closed file from the line shown above.

I'm not really sure if it is terminating because it reached some stopping condition for stochastic simulations or some solver error. But, it is odd that the last time point reaches a different value in subsequent runs with the same seed (for instance, 22672.7, 22762.8, 22882.9 or 23003.0).

The code to reproduce the simulation would be unnecessarily complex to share, as I'm translating a model from other framework to gillespy2, but I can share the generated files (sim-files.zip) from which the model is compiled and run with this line:

with subprocess.Popen(sim_args, stdout=subprocess.PIPE, **platform_args) as simulation:

The sim_args are: GillesPy2_Simulation.exe --trajectories 1 --timesteps 1000 --end 30000.0 --interval 1000 --seed 3. Running this outputs several numbers to stdout, freezes, and then outputs some more after Ctrl+C. So, maybe this is enough to reproduce the behaviour?

I'm running this on a Mac M2 in a conda environment with this package versions:

Package    Version  Build               Size       Kind   Source
gillespy2  1.8.2    pyhd8ed1ab_0        250.4 KiB  conda  gillespy2-1.8.2-pyhd8ed1ab_0.conda
python     3.12.5   h30c5eda_0_cpython  12.3 MiB   conda  python-3.12.5-h30c5eda_0_cpython.conda
scons      4.7.0    py312h81bd7bf_0     2.6 MiB    conda  scons-4.7.0-py312h81bd7bf_0.conda

Let me know if you need anything else to reproduce (or I'm doing anything wrong).

Thanks!
Mauro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions