Skip to content

adios2

ADIOS2 (Adaptable Input Output System) is a high-performance library designed to handle large-scale data management in scientific computing. It provides flexible and efficient I/O for simulations and data-driven workflows. The entity code uses ADIOS2 for efficient output of complex and distributed data across architectures. This wiki gathers practical examples to get started with visualizing ADIOS2-generated data and post-processing pipelines.

ADIOS2's BP5 format in entity

You can enable BP5 output in entity simulations by changing the following line in your .toml file:

[output]
    format = "BP5"

ADIOS2 Python Interface

ADIOS2 provides a python interface to load data for post-processing, for example in a jupyter notebook. Following the ADIOS2 documentation, a simple way to open ADIOS2 BP5 format can be implemented as follows (replace FILENAME):

import numpy as np
from adios2 import Stream

with Stream("FILENAME.bp", "r") as s:
    for _ in s.steps():
        # track current step
        print(f"Current step is {s.current_step()}")

        # inspect variables in current step
        for name, info in s.available_variables().items():
            print("variable_name: " + name, end=" ")
            for key, value in info.items():
                print("\t" + key + ": " + value, end=" ")
            print()

This will generate a summary of all the available output in a BP5 file. The following code opens all electric and magnetic fields and makes their arrays available for post-processing in respectively named variables:

import numpy as np
from adios2 import Stream

with Stream("FILENAME.bp", "r") as s:
    for _ in s.steps():
        # Read the physical time
        physical_time = s.read("Time")
        # Read field arrays
        fields_bx = s.read("fB1")
        fields_by = s.read("fB2")
        fields_bz = s.read("fB3")
        fields_ex = s.read("fE1")
        fields_ey = s.read("fE2")
        fields_ez = s.read("fE3")
        # Read coordinates
        coords_x = s.read("X1")
        coords_y = s.read("X2")

The development of the python interface for output generated in the BP5 format is ongoing. Please share your experiences and feedback!