Hops error for long simulation

Good morning, I’m developing a script to modify idf files and run custom simulations in EnergyPlus through a Python code.

To connect this with my geometry in Rhino I’m using Hops that launches the external python code (that sets all the models and run all the simulations). Every line of the code is properly run but the GH Hops components becomes red after a while and reports that errors could be occured (even though no errors are described in the terminal). Moreover the same script run directly in Visual Studio or Spyder (without the Hops and Flask part of the code) does not raise any error.

I have tried to reduce the energyplus runperiod (and therefore the lenght of the simulations and of all the script) and the same hops component does not generate any error, so I think it is a problem related to the lenght of the simulation. Is there a way to solve this issue? Because otherwise I can’t see the output on the GH component.

Thank you!

The question should be, is there a way to detect the issue?! I would advise making use of a code-profiler. What happens to your memory. Is there a leak? Can you check the instrumentation to spot weird calls? Is your connection terminated after a while, maybe because of system inactivity/time-out? What is the last successful action (is there enough logging)? Can you stress the system with a test to reproduce the issue? Spotting these issues is challenging, usually it’s something else of what you expect… It is also possible that a system catches an exception without a way of informing you through logging. Or even worse, you get a wrong error log. Usually this happens without a good strategy of exception handling, such having as nested try blocks or accepting null states. Another culprit is parallel and concurrent programming, when something is not synchronized properly, and errors might only occur very rarely and non-deterministic.

Thank you for your reply! Honestly I’m not so expert and I don’t know how to check and answer to all your questions… Regarding some of your doubts (i.e. nested try blocks) what I was thinking is that if the code works launching it from other script editors (Spyder and VS) and works using Hops if I simply reduce the simulation time in EnergyPlus (the code and the hops components are exactly the same) probably it is not a problem of the code itself but a problem of the lenght of the process.
I have also just tried to run it asynchronously and it complete all the functions, it does not report error but the component remains in the “solving…” state without give me any output even if I close the terminal. Can this help to understand which is the issue?

Hey,
I ran into a similar or even the same issue some time ago when working with some time-intense simulations. In my case, it was solvable by increasing the timeout value here:

After this amount of time Hops seems to throw an error if the server has not sent any data back yet. After increasing the value also my longer simulations would run fine and completing correctly.

Hope this helps :wave:

1 Like