Commit d1a66666 authored by William F Godoy's avatar William F Godoy
Browse files

HDF5 tests failing when updating step

parent 2db015ad
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ void Stream::CheckOpen()
        if (m_Mode == adios2::Mode::Write)
        {
            m_Engine->BeginStep();
            m_StepStatus = true;
        }
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -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);

+6 −1
Original line number Diff line number Diff line
@@ -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;
    }
}

+6 −3
Original line number Diff line number Diff line
@@ -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
@@ -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)
@@ -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()

@@ -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()

+7 −5
Original line number Diff line number Diff line
@@ -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
@@ -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):
        
@@ -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)
@@ -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()