Skip to content

omc4py stuck in session.buildModel when session.setCommandLineOptions("-d=bltdump") has been set #237

Open

Description

@bmazurie

Hi,
When building or simulating a precise model with omc4py using the CommandLineOptions -d=bltdump, the code get stuck. It is not the case without the lineOption.

How to

When building or simulating ThermoSysPro.Examples.SimpleExamples.TestFan_Qin (from ThermoSysPro lib: ThermoSysPro.zip) it is stuck if the flag -d=bltdump has been set.

Excepted behaviour

The behavior should be the same as when -d=bltdump is not set, in this case, buildModel should return '','' as it fails but should not get stuck.

from omc4py import open_session

model = 'ThermoSysPro.Examples.SimpleExamples.TestFan_Qin'

with open_session(
    omc_exec_path
) as session:
    print(session.getVersion())
    session.loadFile('ThermoSysPro/package.mo')
    session.setCommandLineOptions("-d=bltdump")
    checkModelLog=session.checkModel(model)
    print(checkModelLog)
    buildModelResults = session.buildModel(model)
    print(buildModelResults)

Thank you

Activity

  1. ijknabla commented on Jul 20, 2025

    @ijknabla
    Owner

    I’ve noticed that some commands tend to hang when using omc --interactive=zmq.
    Right now, our code has very limited coverage, so we need to handle many different cases carefully.

    Your insights and issues are really helpful for deepening our understanding of how omc behaves.

    It might actually be a bug in omc itself.
    Even if that’s the case, I’d still like to understand the issue more thoroughly.


    We need more detailed log!
    And please send your stdout/stderr on script below.

       from omc4py import open_session
    ++ import logging
    
    ++ logging.getLogger("omc4py").setLevel(logging.DEBUG)
    ++ logging.getLogger("omc4py").addHandler(logging.FileHandler("omc4py.log"))
    ++ # Plese send `omc4py.log` after execute script
    
       model = 'ThermoSysPro.Examples.SimpleExamples.TestFan_Qin'
    
       with open_session(
           omc_exec_path
       ) as session:
           print(session.getVersion())
           session.loadFile('ThermoSysPro/package.mo')
           session.setCommandLineOptions("-d=bltdump")
           checkModelLog=session.checkModel(model)
           print(checkModelLog)
           buildModelResults = session.buildModel(model)
    ++     session.__check__()
           print(buildModelResults)
    • omc returns Modelica-expression-string as return value
    • omc4py compile these strings by Modelica syntax, and construct python values

    We need to know which is omc's failure or omc4py's failure.

    I am not a regular English speaker, and I am using a translation tool to write this response.
    If anything is unclear, please let me know and I will rewrite the sentence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions