Open casella opened 4 days ago
The model appears to get stuck in fmi2_freeInstance
, which suggests there might be an issue with the FMU itself. It would be helpful if someone could investigate the FMI export to identify potential problems with the generated FMU.
@arun3688 could you please check?
@lochel, what is strange is that the same FMU works fine with FMPy. Is OMSimulator calling the FMU differently?
The code gets stuck inside fmi2_freeInstance, specifically when invoking callExternalObjectDestructors:
/* call external objects destructors */
comp->fmuData->callback->callExternalObjectDestructors(comp->fmuData, comp->threadData);
The callExternalObjectDestructors implementation appears as follows:
void NaturalConvectionWithControl_callExternalObjectDestructors(DATA *data, threadData_t *threadData)
{
if(data->simulationInfo->extObjs)
{
omc_Modelica_Blocks_Types_ExternalCombiTable1D_destructor(threadData,(data->simulationInfo->extObjs[1]));
omc_Modelica_Blocks_Types_ExternalCombiTable1D_destructor(threadData,(data->simulationInfo->extObjs[2]));
omc_Buildings_ThermalZones_Detailed_BaseClasses_CFDThread_destructor(threadData,(data->simulationInfo->extObjs[0]));
free(data->simulationInfo->extObjs);
data->simulationInfo->extObjs = 0;
}
}
It seems the issue arises during the execution of one of the destructors. This needs further investigation by someone familiar with the runtime system to determine:
The issue description mentioned a log message that contained an incorrect function name. This has been corrected in OpenModelica/OpenModelica#13312.
@arun3688 can you please look into that when you have time?
@casella sure i will look into this
After #1271 was fixed, the master-fmi report for Buildings 11.0.0, which uses OMSimulator, reports 1462 model simulating successfully, whereas the master-fmi-fmpy, that uses FMPy, only reports 1355. So, it seems OMSimulator has a higher simulation success rate.
However, I compared some results and I found them incorrectly reported. For example, the
Buildings.ThermalZones.Detailed.Examples.FFD.NaturalConvectionWithControl
simulation is reported to fail during simulation (orange cell) in the master-fmi-fmpy report, more specifically during initialization, with the following error log:The same test in the master-fmi log reports a success (green), even though there is no result file to verify and the simulation log also mentions an initialization error.
I guess the exit code of OMSimulator is wrong - in this case, OMSimulator should return a non-zero exit code, since the simulation was not successful.
@lochel, please check with @adrpo how OMSimulator should terminate in these cases, in order to get correct CI test reports.