alfalfa
alfalfa copied to clipboard
OSMs: SimulationControl with 'Do HVAC Sizing Simulation for Sizing Periods' Causes Timeout
Jeez louise. I think I figured out what the problem was, but wanted to document here. Also, wanted to get your opinion @kbenne @anyaelena if this is something Alfalfa should be resilient to or not (as my solution kinda just bypasses the issue):
Setup
Using images:
- nrel/alfalfa-grafana:
a4b4ed455d17
- nrel/alfalfa-web:
b7ff5548918b
- nrel/alfalfa-worker:
3fda3e1c3789
I was going through the following:
- Generate OSM using 'Create Typical' measure
- Use that OSM to submit to alfalfa (no modifications)
Issue
alfalfa_worker was throwing a socket timeout error:
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Server started on 127.0.0.1:43679
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Wrote socket.cfg
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Launch EnergyPlus
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Traceback (most recent call last):
alfalfa_worker.1.yknoro81sx1l@docker-desktop | File "step_sim/step_osm.py", line 31, in <module>
alfalfa_worker.1.yknoro81sx1l@docker-desktop | m.run()
alfalfa_worker.1.yknoro81sx1l@docker-desktop | File "/alfalfa/alfalfa_worker/step_sim/model_advancer.py", line 82, in run
alfalfa_worker.1.yknoro81sx1l@docker-desktop | self.init_sim()
alfalfa_worker.1.yknoro81sx1l@docker-desktop | File "/alfalfa/alfalfa_worker/step_sim/osm_model_advancer.py", line 89, in init_sim
alfalfa_worker.1.yknoro81sx1l@docker-desktop | [self.ep.status, self.ep.msg] = self.ep.accept_socket()
alfalfa_worker.1.yknoro81sx1l@docker-desktop | File "/usr/local/lib/python3.6/dist-packages/mlep/mlep_process.py", line 162, in accept_socket
alfalfa_worker.1.yknoro81sx1l@docker-desktop | (self.comm_socket, self.client_address) = self.server_socket.accept()
alfalfa_worker.1.yknoro81sx1l@docker-desktop | File "/usr/lib/python3.6/socket.py", line 205, in accept
alfalfa_worker.1.yknoro81sx1l@docker-desktop | fd, addr = self._accept()
alfalfa_worker.1.yknoro81sx1l@docker-desktop | socket.timeout: timed out
alfalfa_worker.1.yknoro81sx1l@docker-desktop | 2021-04-08 15:22:30,829 - alfalfa_worker - INFO - step_sim unsuccessful for: 178649b0-987e-11eb-b77d-c35343e29841
alfalfa_worker.1.yknoro81sx1l@docker-desktop | INFO:alfalfa_worker:step_sim unsuccessful for: 178649b0-987e-11eb-b77d-c35343e29841
alfalfa_worker.1.yknoro81sx1l@docker-desktop | 2021-04-08 15:22:31,256 - alfalfa_worker - INFO - step_sim return code: 1
alfalfa_worker.1.yknoro81sx1l@docker-desktop | INFO:alfalfa_worker:step_sim return code: 1
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Error when connecting to socket: Connection refused
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Program terminated: EnergyPlus Terminated--Error(s) Detected.
alfalfa_worker.1.yknoro81sx1l@docker-desktop | Error when connecting to socket: Connection refused
When I got down into it, I found the following:
utilSocket.log:
utilSocket: Establishing socket based on file socket.cfg.
Getting socket port number.
Received socket port number 40903.
Socket port number = 40903.
Socket opened, sockfd = 16.
Error when connecting to socket: Connection refused
utilSocket: Establishing socket based on file socket.cfg.
Getting socket port number.
Received socket port number 40903.
Socket port number = 40903.
Socket opened, sockfd = 4.
Error when connecting to socket: Connection refused
mlep.log
Beginning Primary Simulation
Initializing New Environment Parameters
Warming up {1}
Instantiating Building Controls Virtual Test Bed
ExternalInterface initializes.
**FATAL:Error in ExternalInterface: Check EnergyPlus *.err file.
EnergyPlus Run Time=00hr 00min 32.99sec
EnergyPlus output files are located in: "/simulate/72137b10-985a-11eb-b91d-1df214baffa9/simulation/Output"
===== EnergyPlus terminated with error =====
Output/sim.err:
************* Beginning Simulation
** Severe ** ExternalInterface: Could not open socket. File descriptor = -1.
** Fatal ** Error in ExternalInterface: Check EnergyPlus *.err file.
...Summary of Errors that led to program termination:
..... Reference severe error count=1
..... Last severe error=ExternalInterface: Could not open socket. File descriptor = -1.
. . .
************* ===== Final Error Summary =====
************* The following error categories occurred. Consider correcting or noting.
************* Nominally Unused Constructions
************* ..The nominally unused constructions warning is provided to alert you to potential conditions that can cause
************* ..extra time during simulation. Each construction is calculated by the algorithm indicated in the HeatBalanceAlgorithm
************* ..object. You may remove the constructions indicated (when you use the DisplayExtraWarnings option).
*************
************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 1 Severe Errors.
************* EnergyPlus Sizing Error Summary. During Sizing: 31 Warning; 0 Severe Errors.
************* EnergyPlus Terminated--Fatal Error Detected. 51565 Warning; 1 Severe Errors; Elapsed Time=00hr 00min 32.99sec
Solution / Workaround
- The issue has to do with the
OS:SimulationControl
, specifically, theDo HVAC Sizing Simulation for Sizing Periods
Doesn't work:
OS:SimulationControl,
{fe5b5f3c-f637-4fd1-a2b3-f4d09456dccb}, !- Handle
Yes, !- Do Zone Sizing Calculation
Yes, !- Do System Sizing Calculation
Yes, !- Do Plant Sizing Calculation
No, !- Run Simulation for Sizing Periods
Yes, !- Run Simulation for Weather File Run Periods
0.04, !- Loads Convergence Tolerance Value {W}
0.2, !- Temperature Convergence Tolerance Value {deltaC}
FullInteriorAndExterior, !- Solar Distribution
25, !- Maximum Number of Warmup Days
6, !- Minimum Number of Warmup Days
Yes, !- Do HVAC Sizing Simulation for Sizing Periods
1; !- Maximum Number of HVAC Sizing Simulation Passes
- Changing the parameter to
No
or deleting the last two lines solves the issue.
Recommend Next Steps:
- Decide if this is a feature we want to support (seems low ROI...)
- If not, we should probably:
- Change this parameter to 'No' if defined OR remove the two fields