Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiling fails when cse- and pre-variables are used #55

Open
cbermperi opened this issue Nov 14, 2022 · 2 comments
Open

Profiling fails when cse- and pre-variables are used #55

cbermperi opened this issue Nov 14, 2022 · 2 comments

Comments

@cbermperi
Copy link
Contributor

During the profiling of the model 'Modelica_4.0.0/files/Modelica_4.0.0_Modelica.Electrical.Analog.Examples.HeatingNPN_NORGate.err-' , in step 'Find min-max values of used variables' occurs an ArgumentError, that the auxiliary variable $cse1 is not found in the data frame.

A similar error appears for pre-variables, here is an example of the model 'Modelica_4.0.0/files/Modelica_4.0.0_Modelica.Magnetic.FundamentalWave.Examples.BasicMachines.SynchronousMachines.SMEE_LoadDump.err-':

julia> (csvFiles, fmu, profilingInfo) = main(modelName, moFiles, workdir="/home/cbermperi/workdir/NonLinearSystemNeuralNetworkFMU.jl", reuseArtifacts=true, N=1)
[ Info: Profile SMEE_LoadDump
[ Info: Slowest eq 806: ncall: 15353, time: 1.859202341, maxTime: 0.001216913 , fraction: 0.17759459928549
[ Info: Find min-max values of used varaibles
ERROR: ArgumentError: column name :$PRE.switch.closerWithArc[3].quenched not found in the data frame
Stacktrace:
 [1] lookupname
   @ ~/.julia/packages/DataFrames/a6np0/src/other/index.jl:392 [inlined]
 [2] getindex
   @ ~/.julia/packages/DataFrames/a6np0/src/other/index.jl:401 [inlined]
 [3] getindex
   @ ~/.julia/packages/DataFrames/a6np0/src/other/index.jl:402 [inlined]
 [4] getindex(df::DataFrames.DataFrame, #unused#::typeof(!), col_ind::String)
   @ DataFrames ~/.julia/packages/DataFrames/a6np0/src/dataframe/dataframe.jl:525
 [5] minMaxValues(resultFile::String, variables::Vector{String}; epsilon::Float64)
   @ NonLinearSystemNeuralNetworkFMU ~/workdir/NonLinearSystemNeuralNetworkFMU.jl/src/profiling.jl:316
 [6] minMaxValues
   @ ~/workdir/NonLinearSystemNeuralNetworkFMU.jl/src/profiling.jl:310 [inlined]
 [7] #minMaxValuesReSim#18
   @ ~/workdir/NonLinearSystemNeuralNetworkFMU.jl/src/profiling.jl:403 [inlined]
 [8] main(modelName::String, moFiles::Vector{String}; workdir::String, reuseArtifacts::Bool, N::Int64)
   @ NonLinearSystemNeuralNetworkFMU ~/workdir/NonLinearSystemNeuralNetworkFMU.jl/src/main.jl:78
 [9] top-level scope
   @ REPL[9]:1
@phannebohm
Copy link
Collaborator

OpenModelica/OpenModelica#10063 might have fixed this. Please try again with the latest version of omc. 🙂

@AnHeuermann
Copy link
Collaborator

I tested

model IEEE_14_Buses
  extends OpenIPSL.Examples.IEEE14.IEEE_14_Buses;
  annotation(
    uses(
      OpenIPSL(version="3.0.1")),
    experiment(
      StopTime=10,
      Interval=0.001,
      Tolerance=1e-06));
end IEEE_14_Buses;

with omc v1.21.0-dev-216-ge469b0cb37-cmake and it still seems to have trouble with cse variables. Problem is not only when a cse variable is a iteration variable but when it is used at all inside the loop. But I guess it is fixable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants