0

EnergyPlusPlugin - How to dispose resources after simulation?

Hi, is there any method of EnergyPlusPlugin which is called by E+ before the simulation terminates? Generally, is there any way the plugin instance can recognize the simulation is done?

Why am I asking? I want to correctly dispose resources (=socket) created in the EnergyPlusPlugin instance.

kem's avatar
51
kem
asked 2022-08-01 08:14:12 -0500
Aaron Boranian's avatar
14.1k
Aaron Boranian
updated 2022-08-01 12:09:36 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

I suggest running the API in Library Mode, that way you have a script that calls a function that runs the simulation, and after that function call you can call whatever other function to dispose resources. You could call delete_state, which frees the memory, after your simulation completes, but I think this may happen automatically (?) at the end of a simulation.

    import EnergyPlusAPI as eplus_api
    eplus_api.runtime.run_energyplus(state)
    clear_resources()
ericmartinpe's avatar
2.1k
ericmartinpe
answered 2022-08-03 14:52:53 -0500
edit flag offensive 0 remove flag delete link

Comments

Thank you. The point is we already have quite complex solution using plugin mode. So I am trying to investigate solution with plugin first.

kem's avatar kem (2022-08-06 12:30:18 -0500) edit
1

So. After waiting a while my conclusion is: There is no way to recognize the simulation is done in the Python Plugin mode.

kem's avatar kem (2022-09-15 05:46:25 -0500) edit
add a comment see more comments