Instrumenting Your Simulation with Catalyst for In Situ Analysis
Analyzing simulation data after writing it to disk can create a significant bottleneck. In situ analysis moves that work into the running simulation, where data can be analyzed in memory and selected results written to storage. For developers adopting this approach, the first challenge is connecting their simulation to the analysis pipeline.
In our webinar, Instrumenting Your Simulation with Catalyst for In Situ Analysis, Kitware’s Jeff Lee and Berk Geveci walk through that integration using an AMReX example. The session covers the Catalyst API, mesh and field descriptions, build configuration, and troubleshooting, taking an existing simulation from its time loop to in situ visualization.
How Catalyst 2 Connects Simulation and Analysis
Catalyst 2 changes what developers need to build into their simulation adaptor. With Catalyst 1, the adaptor constructed VTK data objects, and the simulation compiled and linked against the ParaView SDK. With Catalyst 2, the adaptor describes the simulation’s data using the Conduit Mesh Blueprint. ParaView then constructs the VTK objects used for analysis.
The simulation links to the Catalyst library, and the analysis implementation is selected at runtime. This allows the same simulation binary to use the Catalyst stub for testing or load ParaView for analysis without rebuilding.
The AMReX walkthrough centers on three calls: catalyst_initialize before the time loop, catalyst_execute at the desired analysis steps, and catalyst_finalize after the loop. The adaptor receives information the simulation already assembles for its plotfile writer, including mesh data, variable names, and geometry.
Describing the Data Correctly
Those API calls provide the connection, but Catalyst also needs an accurate description of the data. The Conduit Mesh Blueprint identifies the coordinates, mesh topology, and associated fields.
For the AMReX example, the adaptor uses the amrmesh channel and describes each AMR box as a separate domain. Each domain includes its refinement level, origin, spacing, dimensions, and field values. Domain identifiers must be unique across all MPI ranks.
The session also explains when data can be shared directly with Catalyst. Using set_external allows an array to be referenced without copying it, provided the array remains valid until catalyst_execute returns. Other layouts require repacking. In the demonstrated adaptor, AMReX grow cells can interrupt the contiguous layout of valid cells, requiring those values to be copied.
Checking the description early helps catch errors before they reach the analysis pipeline. Blueprint verification can identify missing topology information, incorrect dimensions, and field lengths that do not match the mesh.
Keeping the Build Consistent
A correct data description is only part of a working integration. The simulation, Catalyst, and ParaView also need compatible build configurations.
The webinar highlights two requirements: use one compatible MPI configuration within the process, and keep the internal or external Conduit configuration consistent across the components. Violating either requirement can cause failures during initialization or execution.
The walkthrough connects common symptoms to their underlying causes. An implementation rejected during initialization can indicate a Conduit mismatch, while an implementation that cannot be found can point to an incorrect search path. A pipeline script that fails on proxy names may have been generated with a different ParaView version.
These examples give developers specific places to investigate when an initial integration does not produce the expected output.
Handling Distributed AMR Analysis
Distributed AMR introduces additional considerations. Neighboring boxes need ghost information to compute consistent values at shared boundaries, while interfaces between refinement levels require separate handling.
The demonstration shows how ghost-cell generation and AMR interface processing work together to close contour surfaces across boxes, ranks, and refinement levels. It also identifies an important limitation: the complete parallel result shown used a local build containing VTK fixes that had not yet been submitted at the time of the webinar.
The slides distinguish that demonstration from released behavior and outline the available options, including parallel extracts and slices. Developers evaluating AMR contours should pay particular attention to these version-specific limitations.
Changing the Analysis Without Rebuilding
Once the simulation describes its data, the analysis can be defined separately in a Catalyst script. The webinar demonstrates extract-only and rendering pipelines, allowing the same instrumented simulation to write AMR datasets or generate isosurface images.
Developers can author these pipelines in ParaView by loading representative data, creating the desired filters and extracts, and selecting Save Catalyst State.
For troubleshooting, catalyst_replay provides a way to work independently of the simulation. Developers can dump the nodes sent to Catalyst and replay them with the same MPI rank count to iterate on scripts or reproduce a failure.
The session closes with work in development on an MFEM adaptor using Fides and VTK cell grids to represent high-order elements without refining them into linear elements.
Bring In Situ Analysis to Your Simulation
Working to integrate Catalyst into an existing simulation?
Connect with Kitware to discuss your data, build configuration, and analysis needs.