Abstract
Modern high-performance scientific simulations generate data at rates that far exceed the capacity of traditional I/O systems. To address this, in situ visualization processes data in memory while the simulation runs. However, creating adaptive workflows—where visualization tasks respond dynamically to simulation events—remains a significant challenge due to the complexity of managing state and parallel synchronization in traditional programming environments. We introduce DIVA, a domain-specific language (DSL) that applies Functional Reactive Programming (FRP) principles to in situ visualization. DIVA enables researchers to express complex, reactive logic through a high-level declarative syntax while maintaining the performance of hand-optimized C++ code.
Introduction
As supercomputing moves toward the exascale, the "I/O bottleneck" has become a primary constraint for scientific discovery. In situ visualization offers a solution by processing data before it hits the disk. The next frontier in this field is adaptive workflows: systems that can automatically adjust visualization parameters or trigger data saves based on detected physical phenomena, such as the emergence of a combustion kernel. Implementing these triggers in C++ or Python often leads to "callback hell" and synchronization errors across parallel MPI ranks. DIVA addresses these issues by treating simulation data as continuous signals and providing a framework that automatically manages execution dependencies and parallel consistency.
System Architecture
DIVA is structured as a multi-layered system designed to bridge the gap between high-level user intent and low-level hardware performance.
The architecture consists of three core components:
- Declarative DSL: Users define relationships between data and actions using a reactive syntax. For example, a trigger can be defined to save an image only when a temperature threshold is met.
- Workflow Manager: This layer parses the DSL into a Directed Acyclic Graph (DAG). It employs lazy evaluation and caching to ensure that computationally expensive visualization tasks are only executed when their triggers are activated.
- Low-Level C++ API: To ensure extensibility and performance, DIVA allows developers to implement custom primitives in C++. These modules are then orchestrated by the high-level DSL.
Reactive Programming and Parallel Execution
At its core, DIVA leverages Functional Reactive Programming. By treating simulation data as "signals" rather than discrete updates, the language allows for complex temporal operations without manual state management.
A key innovation in DIVA is its handling of parallel synchronization. In large-scale simulations using MPI, if one processor rank triggers an action while another does not, the simulation can deadlock. DIVA's runtime tracks whether a function is "global" (requiring synchronization) or "local." As shown in the figure above, the system ensures that all ranks participate in global operations (like reductions or collective I/O) even if the trigger was only logically activated by a subset of ranks. Additionally, DIVA introduces "Window" functions to manage temporal state efficiently, keeping only a small buffer of historical data needed for feature tracking.
Evaluation and Results
DIVA was evaluated using the S3D combustion solver on the Summit supercomputer, scaling up to 32,768 MPI ranks. The evaluation focused on an anomaly detection case study in turbulent premixed auto-ignition.
- Performance: Scaling tests demonstrated that DIVA introduces negligible overhead, typically within ±6% of a hand-optimized C++ implementation. In some high-resolution scenarios, DIVA's DAG-based optimization actually outperformed manual C++ code by more efficiently managing metric calculations.
- Usability: Complex adaptive logic that previously required extensive boilerplate code can be expressed in DIVA with significantly fewer lines of code, reducing the likelihood of memory leaks and synchronization bugs.
Conclusion and Future Work
DIVA demonstrates that high-level declarative abstractions can be both expressive and performant for extreme-scale scientific computing. While the current implementation focuses on in situ workflows, future work aims to extend support to "in-transit" environments where data is moved to dedicated visualization nodes. Additionally, the authors plan to expand the DSL to support more complex control structures while maintaining the safety and synchronization guarantees provided by the current reactive model.
Summary updated