Loading source/adios2/core/Stream.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ void Stream::CheckOpen() if (m_Mode == adios2::Mode::Write) { m_Engine->BeginStep(); m_StepStatus = true; } } } Loading source/adios2/core/Stream.h +2 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ private: /** internal flag to check if getstep was called */ bool m_FirstStep = true; bool m_StepStatus = false; template <class T> std::vector<T> GetCommon(Variable<T> &variable); Loading source/adios2/core/Stream.tcc +6 −1 Original line number Diff line number Diff line Loading @@ -44,13 +44,18 @@ void Stream::Write(const std::string &name, const T *data, const Dims &shape, } CheckOpen(); if (!m_StepStatus) { m_Engine->BeginStep(); m_StepStatus = true; } m_Engine->Put(*variable, data, adios2::Mode::Sync); if (endStep) { m_Engine->EndStep(); m_Engine->BeginStep(); m_StepStatus = false; } } Loading testing/adios2/bindings/python/TestBPWriteTypesHighLevelAPI.py +6 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ # Author: William F Godoy godoywf@ornl.gov import sys from adios2NPTypes import SmallTestData from mpi4py import MPI import numpy as np Loading Loading @@ -47,7 +48,7 @@ with adios2.open("types_np.bp", "w", comm) as fw: fw.write("gvarR32", np.array(data.R32[0])) fw.write("gvarR64", np.array(data.R64[0])) print("i: " + str(i)) print("Write Step: " + str(i) + " rank: " + str(rank)) fw.write("steps", "Step:" + str(i)) fw.write("varI8", data.I8, shape, start, count) fw.write("varI16", data.I16, shape, start, count) Loading @@ -61,6 +62,8 @@ with adios2.open("types_np.bp", "w", comm) as fw: fw.write("varR64", data.R64, shape, start, count, endl=True) comm.Barrier() sys.stdout.flush() # Reader data = SmallTestData() Loading @@ -71,7 +74,7 @@ with adios2.open("types_np.bp", "r", comm) as fr: step = fr_step.currentstep() data.update(rank, step, size) print("Step: " + str(step)) print("Reader Step: " + str(step)) step_vars = fr_step.availablevariables() Loading testing/adios2/bindings/python/TestBPWriteTypesHighLevelAPI_HDF5.py +7 −5 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ # Created on: March 12, 2018 # Author: William F Godoy godoywf@ornl.gov import sys from adios2NPTypes import SmallTestData from mpi4py import MPI import numpy as np Loading @@ -28,7 +28,7 @@ start = [rank * nx] count = [nx] # Writer with adios2.open("types_np.bp", "w", comm, "HDF5") as fw: with adios2.open("types_np.h5", "w", comm, "HDF5") as fw: for i in range(0, 5): Loading @@ -47,7 +47,7 @@ with adios2.open("types_np.bp", "w", comm, "HDF5") as fw: fw.write("gvarR32", np.array(data.R32[0])) fw.write("gvarR64", np.array(data.R64[0])) print("i: " + str(i)) print("Write Step: " + str(i) + " rank: " + str(rank)) fw.write("steps", "Step:" + str(i)) fw.write("varI8", data.I8, shape, start, count) fw.write("varI16", data.I16, shape, start, count) Loading @@ -61,17 +61,19 @@ with adios2.open("types_np.bp", "w", comm, "HDF5") as fw: fw.write("varR64", data.R64, shape, start, count, endl=True) comm.Barrier() sys.stdout.flush() # Reader data = SmallTestData() with adios2.open("types_np.bp", "r", comm, "HDF5") as fr: with adios2.open("types_np.h5", "r", comm, "HDF5") as fr: for fr_step in fr: step = fr_step.currentstep() data.update(rank, step, size) print("Step: " + str(step)) print("Reader Step: " + str(step)) step_vars = fr_step.availablevariables() Loading Loading
source/adios2/core/Stream.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,7 @@ void Stream::CheckOpen() if (m_Mode == adios2::Mode::Write) { m_Engine->BeginStep(); m_StepStatus = true; } } } Loading
source/adios2/core/Stream.h +2 −0 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ private: /** internal flag to check if getstep was called */ bool m_FirstStep = true; bool m_StepStatus = false; template <class T> std::vector<T> GetCommon(Variable<T> &variable); Loading
source/adios2/core/Stream.tcc +6 −1 Original line number Diff line number Diff line Loading @@ -44,13 +44,18 @@ void Stream::Write(const std::string &name, const T *data, const Dims &shape, } CheckOpen(); if (!m_StepStatus) { m_Engine->BeginStep(); m_StepStatus = true; } m_Engine->Put(*variable, data, adios2::Mode::Sync); if (endStep) { m_Engine->EndStep(); m_Engine->BeginStep(); m_StepStatus = false; } } Loading
testing/adios2/bindings/python/TestBPWriteTypesHighLevelAPI.py +6 −3 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ # Author: William F Godoy godoywf@ornl.gov import sys from adios2NPTypes import SmallTestData from mpi4py import MPI import numpy as np Loading Loading @@ -47,7 +48,7 @@ with adios2.open("types_np.bp", "w", comm) as fw: fw.write("gvarR32", np.array(data.R32[0])) fw.write("gvarR64", np.array(data.R64[0])) print("i: " + str(i)) print("Write Step: " + str(i) + " rank: " + str(rank)) fw.write("steps", "Step:" + str(i)) fw.write("varI8", data.I8, shape, start, count) fw.write("varI16", data.I16, shape, start, count) Loading @@ -61,6 +62,8 @@ with adios2.open("types_np.bp", "w", comm) as fw: fw.write("varR64", data.R64, shape, start, count, endl=True) comm.Barrier() sys.stdout.flush() # Reader data = SmallTestData() Loading @@ -71,7 +74,7 @@ with adios2.open("types_np.bp", "r", comm) as fr: step = fr_step.currentstep() data.update(rank, step, size) print("Step: " + str(step)) print("Reader Step: " + str(step)) step_vars = fr_step.availablevariables() Loading
testing/adios2/bindings/python/TestBPWriteTypesHighLevelAPI_HDF5.py +7 −5 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ # Created on: March 12, 2018 # Author: William F Godoy godoywf@ornl.gov import sys from adios2NPTypes import SmallTestData from mpi4py import MPI import numpy as np Loading @@ -28,7 +28,7 @@ start = [rank * nx] count = [nx] # Writer with adios2.open("types_np.bp", "w", comm, "HDF5") as fw: with adios2.open("types_np.h5", "w", comm, "HDF5") as fw: for i in range(0, 5): Loading @@ -47,7 +47,7 @@ with adios2.open("types_np.bp", "w", comm, "HDF5") as fw: fw.write("gvarR32", np.array(data.R32[0])) fw.write("gvarR64", np.array(data.R64[0])) print("i: " + str(i)) print("Write Step: " + str(i) + " rank: " + str(rank)) fw.write("steps", "Step:" + str(i)) fw.write("varI8", data.I8, shape, start, count) fw.write("varI16", data.I16, shape, start, count) Loading @@ -61,17 +61,19 @@ with adios2.open("types_np.bp", "w", comm, "HDF5") as fw: fw.write("varR64", data.R64, shape, start, count, endl=True) comm.Barrier() sys.stdout.flush() # Reader data = SmallTestData() with adios2.open("types_np.bp", "r", comm, "HDF5") as fr: with adios2.open("types_np.h5", "r", comm, "HDF5") as fr: for fr_step in fr: step = fr_step.currentstep() data.update(rank, step, size) print("Step: " + str(step)) print("Reader Step: " + str(step)) step_vars = fr_step.availablevariables() Loading