The following minimal example using the ADIOS2 Python interface (2.10.2), shows a difference in how variables are handled in the BP4 and BP5 formats.
import adios2.bindings as adios2
from mpi4py import MPI
def read_attr(engine):
filename = "test_" + engine + ".bp"
adios = adios2.ADIOS(MPI.COMM_WORLD)
io = adios.DeclareIO("reader" + engine)
io.SetEngine(engine)
file = io.Open(str(filename), adios2.Mode.Read)
print(engine, io.AvailableAttributes().keys())
for step in range(file.Steps()):
file.BeginStep()
print(engine, step, io.AvailableAttributes().keys())
file.EndStep()
file.Close()
adios.RemoveIO("reader"+engine)
def write_attr(engine):
filename = "test_" + engine + ".bp"
# Write two attributes to file
adios = adios2.ADIOS(MPI.COMM_WORLD)
io = adios.DeclareIO("writer" + engine)
io.SetEngine(engine)
adios_file = io.Open(str(filename), adios2.Mode.Write, MPI.COMM_WORLD)
adios_file.BeginStep()
io.DefineAttribute("a", "first")
adios_file.PerformPuts()
adios_file.EndStep()
adios_file.BeginStep()
io.DefineAttribute("b", "last")
adios_file.PerformPuts()
adios_file.EndStep()
adios_file.Close()
adios.RemoveIO("writer"+"engine")
if __name__ == "__main__":
write_attr("BP4")
read_attr("BP4")
write_attr("BP5")
read_attr("BP5")
This yields:
BP4 dict_keys(['a'])
BP4 0 dict_keys(['a'])
BP5 dict_keys([])
BP5 0 dict_keys(['a'])
BP5 1 dict_keys(['a', 'b'])
Which makes the handling of both formats within Python very hard to maintain.
Is this a change that was made on purpose or a bug?
The following minimal example using the ADIOS2 Python interface (2.10.2), shows a difference in how variables are handled in the
BP4andBP5formats.This yields:
Which makes the handling of both formats within Python very hard to maintain.
Is this a change that was made on purpose or a bug?