getSimulationOverruns

Hi Team,

I am trying to create an automation script in the Sequencer to print the overrun count after each simulation run.
With the script below, I am encountering the error shown in the description.
The error indicates that the HYPERSIM Python API does not expose the method: getSimulationOverruns()

**python script: **
from modules.hypersim_connection import connect
import time

api = connect()

api.startSim()

time.sleep(5)

overruns = api.getSimulationOverruns()

print(
f"Overrun Count = {overruns}"
)

api.stopSim()

Console output:

Connecting to HyWorks…
[2026-10-16 17:18:11,424][RegistryApiTool][INFO] Getting Running Services of type HyWorks on service port 13520
[2026-10-16 17:18:11,434][RegistryApiTool][INFO] Getting Application Services for HyWorks
[2026-10-16 17:18:11,443][RegistryApiTool][INFO] Connecting to /administrator/hyworks-1 pid 39848 on port 50992
[2026-10-16 17:18:11,443][RegistryApiTool][INFO] Connected!
[2026-10-16 17:18:11,450][HyWorksPythonApi][INFO] Connected to HyWorks in 0.026s
Starting and connecting to HYPERSIM…
[2026-10-16 17:18:11,450][RegistryApiTool][INFO] Getting Running Services of type HyWorks on service port 13520
[2026-10-16 17:18:11,450][RegistryApiTool][INFO] Getting Application Services for HyWorks
[2026-10-16 17:18:11,458][RegistryApiTool][INFO] Connecting to /administrator/hyworks-1 pid 39848 on port 50992
[2026-10-16 17:18:11,458][RegistryApiTool][INFO] Connected!
[2026-10-16 17:18:11,458][HyWorksPythonApi][INFO] Connected to HyWorks in 0.008s
[2026-10-16 17:18:11,458][HyWorksPythonApi][WARNING] Connected to an existing HyWorks session during the startAndConnectHypersim
Opening design…
Traceback (most recent call last):
File “C:\Users\Administrator\OneDrive - Hitachi Energy\Projects\PWC\CVT\CVTValidationResults\FunctionLevel\24Sep\PreProcessing\testoverrun.py”, line 10, in
overruns = api.getSimulationOverruns()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError:
module ‘HyWorksApiGRPC’ has no attribute ‘getSimulationOverruns’. Did you mean: ‘getSimulationTimings’?

Current Environment:

HYPERSIM Version: 2026.3.3.o33 (latest version available in the Download Center)

Could someone please advise on the recommended way to retrieve the overrun count programmatically?

As an alternative, I tried using: getSimulationPerformanceTimings()
which returns a field named: num_stretched_step

As a workaround, I assumed that this might be the closest available indicator of overruns. However, I am not sure whether this interpretation is correct.

Could you please help with:

1.The correct method (if any) to retrieve the actual overrun count from the Python API.
2.Whether num_stretched_step can be considered a valid substitute for overruns.
3.Any alternative approach to monitor or log overrun information after each simulation run from the Sequencer.

Hey! Thanks for sharing the script and logs, that makes it much easier to dig in :slightly_smiling_face:

The missing getSimulationOverruns()

The odd part is that getSimulationOverruns() should exist. It’s in the HyWorksApi docs and returns the current overrun count (
HyWorksApi Commands). When Python says the module doesn’t have it, the usual cause is that your script is loading an older copy of the API. That happens a lot if you have more than one HYPERSIM version installed, or if hypersim_connection points to an old path.

Can you run this quickly and paste what you get?

import HyWorksApiGRPC as api
print(api.file)
print(api.getVersion(long=True))
print([m for m in dir(api) if “verrun” in m.lower() or “Timing” in m])
If the path isn’t your 2026.3.3 install, that’s probably the problem.

Logging overruns per run in the Sequencer

Alternatively, something like this should give you clean numbers for each run:

api.resetSimulationPerformanceTimings() # start each run fresh
api.startSim()
time.sleep(run_duration)
print(f"Overruns = {api.getSimulationOverruns()}") # read before stopping
print(api.getSimulationPerformanceTimings())
api.stopSim()
A few other things that might help:

getSimulationCoreTimings() shows timings per core, so you can see which core is struggling.

startMonitoring() with getMonitoringAllValues() lets you watch live values while the sim runs.

If you’re sweeping time steps, findMinimalStepSize() already handles the overrun loop for you (you’ll need Dashboards enabled).

Share with me when you get a chance and we’ll go from there!

Hi @sorfina,
I encountered a few issues while executing the script you shared, as it appears to contain some errors. Therefore, I attempted an alternative approach using the script below.

import HyWorksApiGRPC as api

print(“Module file:”, api.file)

try:
print(“Version:”, api.getVersion(long=True))
except Exception as e:
print(“getVersion() failed:”, e)

print(“\nPossible timing/overrun related members:”)
print([m for m in dir(api)
if “overrun” in m.lower()
or “timing” in m.lower()
or “performance” in m.lower()
or “step” in m.lower()])

ConsoleOutput:
Running: C:\Users\Administrator\OneDrive - Hitachi Energy\Projects\PWC\CVT\CVTValidationResults\FunctionLevel\24Sep\PreProcessing\TestVer.py
Module file: C:\OPAL-RT\HYPERSIM\hypersim_2026.3.3.o33\Windows\HyApi\python\HyWorksApiGRPC_init_.py
Version: hypersim_2026.3.3.o33

Possible timing/overrun related members:

'\__performance_utils', '\__timings_utils', 'findMinimalStepSize', 'getPreparationTimings', 'getSimulationCoreTimings', 'getSimulationPerformanceTimings', 'getSimulationTimings', 'resetSimulationPerformanceTimings', 'resetTiming'

Process exited with code 0

Conclusion:

The key functions available are:

1.getSimulationPerformanceTimings

2.getSimulationCoreTimings

3.getSimulationTimings

4.getPreparationTimings

5.resetSimulationPerformanceTimings

6.resetTiming

Hey @RAVITEJA, oh I see what you did there! Checking file and getVersion() first confirms you’re on the right 2026.3.3.o33 install, so we can rule out an old copy of the API. And searching on “overrun”, “timing”, “performance” and “step” all at once gives a much clearer list of what’s actually there. Nice!

I think mine went wrong for a few reasons. The forum turned my quotes into curly ones and changed file into bold “file”, so Python couldn’t run it. My second snippet also used run_duration without defining it. And it relied on getSimulationOverruns(), which is in the docs but might not be in your build. Sorry about that!

Hope your project is going well! :blush:

Hi @sorfina,

I downloaded and tested with the latest version available from the OPAL-RT Download Center. Could you please let me know which HYPERSIM version you are currently using?
This will help me verify whether the issue is version-specific or if there are any differences between our environments.

Coming to the project, I have been receiving prompt responses and excellent support from the OPAL-RT team. However, I am currently facing some challenges with the software, particularly related to data recording, which is one of the open issues that I have raised and am actively following up on.

I would like to thank the OPAL-RT team, especially @sorfina and @jakub, for their valuable support and prompt responses throughout the investigation.

Hello, I read this post carefully because it deals with “commissioning” and “configuration” issues of the tools.
This is often hidden time, especially when several of us use the test bench with installations carried out over time by different people. And also when we perform troubleshooting on different benches, or when the PC is used for multiple benches…
So my question: Is there a small diagnostic tool that could check version compatibilities and access (OPAL software, Python, virtual ports…) to help quickly diagnose the configuration? :blush: