Understanding what is happening inside a running HELICS co-simulation is essential for both verifying correct operation and diagnosing problems. HELICS provides a multi-level logging system that produces human-readable output, a query API for inspecting federation state at runtime, and a web interface for monitoring a live co-simulation. This guide explains how to configure all three and how to use them together to debug common issues.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GMLC-TDC/HELICS/llms.txt
Use this file to discover all available pages before exploring further.
Log levels
HELICS defines a hierarchy of log levels. Each level includes all messages from all less-verbose levels above it. Setting a higher level produces more output and can have a measurable performance impact at thedata and trace levels.
| API enumeration | JSON keyword | What it logs |
|---|---|---|
HELICS_LOG_LEVEL_NO_PRINT | no_print | Nothing. Logging is disabled. |
HELICS_LOG_LEVEL_ERROR | error | Internal HELICS errors and faults. |
HELICS_LOG_LEVEL_PROFILING | profiling | Profiling messages for performance analysis. |
HELICS_LOG_LEVEL_WARNING | warning | Unusual or potentially incorrect conditions. |
HELICS_LOG_LEVEL_SUMMARY | summary | Startup and shutdown summaries. The broker logs a count of connected federates. |
HELICS_LOG_LEVEL_CONNECTIONS | connections | Each federate connection and disconnection event. |
HELICS_LOG_LEVEL_INTERFACES | interfaces | Creation of publications, subscriptions, endpoints, and filters. |
HELICS_LOG_LEVEL_TIMING | timing | Mode transitions and time advancement grants. |
HELICS_LOG_LEVEL_DEBUG | debug | Debugging information, similar in volume to timing. |
HELICS_LOG_LEVEL_DATA | data | All data passage events (values sent and received). |
HELICS_LOG_LEVEL_TRACE | trace | All internal HELICS messages, including low-level coordination traffic. |
<name> (<internal_id>) (<flags>)[t=<sim_time>]::<message>. Auto-generated broker or core names (like 26516-enRPa-PzaBB-ZG190-lj14t) include a thread ID prefix.
Configuring logging
In a federate JSON configuration file
loglevel to set the same level for both file and console. Override independently with file_log_level and console_log_level.
On the broker command line
Via the Python API
HELICS_PROPERTY_INT_LOG_LEVEL— both file and consoleHELICS_PROPERTY_INT_FILE_LOG_LEVEL— file onlyHELICS_PROPERTY_INT_CONSOLE_LOG_LEVEL— console only
Setting log file path
- Python API
- Core init string
- HELICS runner JSON
Custom logging callback
You can capture all log messages in your own code rather than writing them to a file:Log buffer
As of HELICS 3.2, federates, cores, and brokers can maintain an in-memory circular buffer of recent log messages. This buffer persists even after a federate disconnects, making it useful for post-run diagnostics. Enable the buffer in JSON:"logs" query (see below).
The web interface
HELICS includes a REST web server that can be attached to a running broker. It is available starting in HELICS 2.4 and requires Boost >= 1.70. It provides an HTTP API for monitoring and interacting with a running co-simulation. Start a broker with the web server enabled:localhost:43542 by default. To change the port or interface:
The federation must be launched via
helics run or the broker server for the web interface to be available. A standalone helics_broker process does not include the web server.Queries for runtime debugging
Queries are the primary tool for inspecting the state of a running federation. Any federate, core, or broker in the federation can be queried. All queries return JSON.Query syntax
Python:Query targets
| Target string | What it resolves to |
|---|---|
"broker" | The first broker this federate is connected to |
"root" or "rootbroker" | The root broker of the entire federation |
"core" | The core attached to this federate |
"federate" | This federate itself |
"<name>" | Any named federate, core, or broker |
Useful federate queries
| Query string | Returns |
|---|---|
"name" | The federate’s identifier string |
"state" | Current state of the federate |
"publications" | List of all publications registered on this federate |
"subscriptions" | List of all subscriptions |
"inputs" | List of all inputs |
"endpoints" | List of all endpoints |
"current_time" | The federate’s current simulation time |
"dependencies" | Objects this federate depends on for time advancement |
"dependency_graph" | Full dependency graph across the federation |
"data_flow_graph" | All data connections in the federation |
"logs" | Buffered log messages (requires logbuffer to be set) |
Useful broker queries
Common issues and solutions
Federation hangs at initialization
Federation hangs at initialization
Symptom: The co-simulation starts but never enters executing mode; all federates are waiting.Causes and solutions:
- The broker was started with
-f Nbut fewer than N federates connected. Check that all expected federate processes actually launched successfully. - A federate failed during startup before calling
helicsFederateEnterExecutingMode. Check that federate’s log for errors. - A required subscription has no matching publisher. Set
logleveltoconnectionsorinterfacesand look for warnings about unmatched interfaces.
Time mismatch or unexpected time grants
Time mismatch or unexpected time grants
Symptom: Log shows
Time mismatch detected granted time > requested time.Cause: A federate was granted a time later than it requested. This typically happens when period and offset settings cause rounding or when a federate requests a time that is not an integer multiple of its declared period.Solution: Set loglevel to timing to see all time grant events. Verify that all time requests are consistent with the period and offset declared in the federate’s configuration.Federate receives stale or zero values
Federate receives stale or zero values
Symptom: A subscription always returns the default value or a value that is several time steps old.Causes and solutions:
- The subscription key does not exactly match the publication key. Check that
globalsettings are consistent between publisher and subscriber. Run thedata_flow_graphquery on the root broker to see whether the connection exists. - The publishing federate has
only_transmit_on_changeenabled and the value hasn’t changed. Disable the flag or verify the publisher is updating the value. - Unit mismatch: if units are specified on both ends and they are incompatible, HELICS may reject the data. Check for unit warning messages at the
warninglog level.
Federate hangs indefinitely during the time loop
Federate hangs indefinitely during the time loop
Symptom: A federate stops advancing in the time loop and never returns from
helicsFederateRequestTime.Cause: Another federate in the federation has stopped responding, which blocks time advancement for all federates that depend on it.Solution: Set terminate_on_error: true on all federates so that a crashed federate causes the entire federation to exit rather than hang. During debugging, use the broker’s --debugging flag (equivalent to --slow_responding --disable_timer) to prevent timeout-based disconnections that might obscure the root cause.Type or unit conversion errors
Type or unit conversion errors
Symptom: Log shows errors about type mismatch or unit mismatch between a publication and subscription.Solution: Enable
strict_input_type_checking: false temporarily to confirm the issue is type-related. Then fix the types to match. HELICS supports automatic conversion between numeric types (int, double, complex) but will error on fundamentally incompatible type pairs. Unit conversion is only performed for double type publications.