lbl-srg / modelica-buildings

Modelica Buildings library
244 stars 153 forks source link

Spawn example TwoIdenticalTwoZoneBuildings has 'process crashed' in OpenModelica #3345

Open mwetter opened 1 year ago

mwetter commented 1 year ago

The model Buildings.ThermalZones.EnergyPlus_9_6_0.Validation.MultipleBuildings.TwoIdenticalTwoZoneBuildings crashes with the log below in OpenModelica on Linux with

OpenModelica 1.22.0~dev-41-g8a5b18f

and also older versions of OpenModelica.

This also crashes with v9.1.0

/tmp/OpenModelica_mwetter/OMEdit/Buildings.ThermalZones.EnergyPlus_9_6_0.Validation.MultipleBuildings.TwoIdenticalTwoZoneBuildings/TwoIdenticalTwoZoneBuildings -port=44065 -logFormat=xmltcp -override=startTime=0,stopTime=172800,stepSize=345.6,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=/tmp/OpenModelica_mwetter/OMEdit/Buildings.ThermalZones.EnergyPlus_9_6_0.Validation.MultipleBuildings.TwoIdenticalTwoZoneBuildings/TwoIdenticalTwoZoneBuildings_res.mat -w -lv=stdout,assert,LOG_STATS -inputPath=/tmp/OpenModelica_mwetter/OMEdit/Buildings.ThermalZones.EnergyPlus_9_6_0.Validation.MultipleBuildings.TwoIdenticalTwoZoneBuildings -outputPath=/tmp/OpenModelica_mwetter/OMEdit/Buildings.ThermalZones.EnergyPlus_9_6_0.Validation.MultipleBuildings.TwoIdenticalTwoZoneBuildings
... loading "EnergyPlus" from "/home/mwetter/proj/ldrd/bie/modeling/github/lbl-srg/modelica-buildings/Buildings/Resources/Data/ThermalZones/EnergyPlus_9_6_0/Validation/TwoIdenticalZones/TwoIdenticalZones.dat" 
... loading "EnergyPlus" from "/home/mwetter/proj/ldrd/bie/modeling/github/lbl-srg/modelica-buildings/Buildings/Resources/Data/ThermalZones/EnergyPlus_9_6_0/Validation/TwoIdenticalZones/TwoIdenticalZones.dat" 
Output TwoIdenticalTwoZoneBuildings.bui.inf1.y has in Modelica the unit 1. 
The following assertion has been violated at time 0.000000 ((bui[2].zon1.duc.m_flow >= 0.0 and bui[2].zon1.duc.m_flow <= 100000.0)) --> "Variable violating min/max constraint: 0.0 <= bui[2].zon1.duc.m_flow <= 100000.0, has value: -2.73576e-14"
The following assertion has been violated at time 0.000000 ((bui[2].zon2.duc.m_flow >= 0.0 and bui[2].zon2.duc.m_flow <= 100000.0)) --> "Variable violating min/max constraint: 0.0 <= bui[2].zon2.duc.m_flow <= 100000.0, has value: -1.36788e-14"
The following assertion has been violated at time 0.000000 ((bui[1].zon1.duc.m_flow >= 0.0 and bui[1].zon1.duc.m_flow <= 100000.0)) --> "Variable violating min/max constraint: 0.0 <= bui[1].zon1.duc.m_flow <= 100000.0, has value: -2.73576e-14"
The following assertion has been violated at time 0.000000 ((bui[1].zon2.duc.m_flow >= 0.0 and bui[1].zon2.duc.m_flow <= 100000.0)) --> "Variable violating min/max constraint: 0.0 <= bui[1].zon2.duc.m_flow <= 100000.0, has value: -1.36788e-14"
The initialization finished successfully without homotopy method.
### STATISTICS ###
timer
   0.0363682s          reading init.xml
  0.00276488s          reading info.xml
  0.00159624s [  0.1%] pre-initialization
     1.36394s [ 81.9%] initialization
 0.000124933s [  0.0%] steps
   0.0144255s [  0.9%] solver (excl. callbacks)
   0.0114918s [  0.7%] creating output-file
    0.153245s [  9.2%] event-handling
  0.00349536s [  0.2%] overhead
    0.117015s [  7.0%] simulation
     1.66533s [100.0%] total
events
  287 state events
    0 time events
solver: dassl
 3926 steps taken
 4794 calls of functionODE
 3190 evaluations of jacobian
   18 error test failures
    0 convergence test failures
0.0487684s time of jacobian evaluation
The simulation finished successfully.
172200.000 TwoIdenticalTwoZoneBuildings.bui.building: Warning from EnergyPlus: The following schedule names are "Unused Schedules".  These schedules are in the idf 
172200.000 TwoIdenticalTwoZoneBuildings.bui.building: Warning from EnergyPlus:  file but are never obtained by the simulation and therefore are NOT used. 
172200.000 TwoIdenticalTwoZoneBuildings.bui.building: Warning from EnergyPlus: The following week schedule names are "Unused Schedules".  These schedules are in the idf 
172200.000 TwoIdenticalTwoZoneBuildings.bui.building: Warning from EnergyPlus:  file but are never obtained by the simulation and therefore are NOT used. 
172200.000 TwoIdenticalTwoZoneBuildings.bui.building: Warning from EnergyPlus: The following day schedule names are "Unused Schedules".  These schedules are in the idf 
172200.000 TwoIdenticalTwoZoneBuildings.bui.building: Warning from EnergyPlus:  file but are never obtained by the simulation and therefore are NOT used. 
Process crashed
EnergyPlus Starting EnergyPlus, Version 9.6.0-316f894e91 (No OpenGL) (No OpenGL) (No OpenGL), YMD=2023.04.18 13:02 Adjusting Air System Sizing Adjusting Standard 62.1 Ventilation Sizing Initializing Simulation Reporting Surfaces Beginning Primary Simulation Initializing New Environment Parameters Warming up {1} Warming up {2} Warming up {3} Warming up {4} Warming up {5} Warming up {6} Warming up {7} Warming up {8} Warming up {9} Warming up {10} Starting Simulation at 01/01/2017 for SPAWN-RUNPERIOD Writing tabular output file results using HTML format. Writing final SQL reports EnergyPlus Run Time=00hr 00min  0.57sec 
EnergyPlus Completed Successfully. 
mwetter commented 1 year ago

Note that EnergyPlus_9_6_0.Validation.MultipleBuildings.TwoIdenticalOneZoneBuildings crashes with

0.0530563s time of jacobian evaluation
The simulation finished successfully.
Process crashed
EnergyPlus Starting EnergyPlus, Version 9.6.0-316f894e91 (No OpenGL) (No OpenGL) (No OpenGL), YMD=2023.05.31 08:07 Adjusting Air System Sizing Adjusting Standard 62.1 Ventilation Sizing Initializing Simulation Reporting Surfaces Beginning Primary Simulation Initializing New Environment Parameters Warming up {1} Warming up {2} Warming up {3} Warming up {4} Warming up {5} Warming up {6} Warming up {7} Warming up {8} Starting Simulation at 01/01/2017 for SPAWN-RUNPERIOD Writing tabular output file results using HTML format. EnergyPlus Run Time=00hr 00min  0.86sec 
EnergyPlus Completed Successfully. double free or corruption (fasttop) 

whereas EnergyPlus_9_6_0.Validation.MultipleBuildings.ThreeZonesTwoBuildings does not crash.

Hence it seems to be triggered by sharing the same idf file which will create one FMU, and then make a copy of it (on disk) for the 2nd building.