Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
guj committed Sep 14, 2020
1 parent 0d44ee2 commit e116bb4
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions testing/adios2/engine/hdf5/TestHDF5Append.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ TEST_F(AppendTimeStepTest, ADIOS2HDF5WriteAppendRead)
#endif

#if ADIOS2_USE_MPI
adios2::ADIOS adios(MPI_COMM_WORLD);
adios2::ADIOS adios(MPI_COMM_WORLD);
#else
adios2::ADIOS adios;
adios2::ADIOS adios;
#endif

// Write test data using HDF5 engine
{
adios2::IO io = adios.DeclareIO("TestIO");
adios2::IO io = adios.DeclareIO("TestIO");

// Declare 1D variables (NumOfProcesses * Nx)
// The local process' part (start, count) can be defined now or later
Expand Down Expand Up @@ -117,7 +117,8 @@ TEST_F(AppendTimeStepTest, ADIOS2HDF5WriteAppendRead)
// variable we write and its offsets in the global spaces
adios2::Box<adios2::Dims> sel({mpiRank * Nx}, {Nx});

//....EXPECT_THROW(var_iString.SetSelection(sel), std::invalid_argument);
//....EXPECT_THROW(var_iString.SetSelection(sel),
//std::invalid_argument);
var_i8.SetSelection(sel);
var_i16.SetSelection(sel);
var_i32.SetSelection(sel);
Expand Down Expand Up @@ -154,27 +155,27 @@ TEST_F(AppendTimeStepTest, ADIOS2HDF5WriteAppendRead)
size_t ExtraSteps = 2;

{
// Append
adios2::IO io = adios.DeclareIO("ioAppend");
// Append
adios2::IO io = adios.DeclareIO("ioAppend");

if (!engineName.empty())
io.SetEngine(engineName);
else
io.SetEngine("HDF5");
if (!engineName.empty())
io.SetEngine(engineName);
else
io.SetEngine("HDF5");

adios2::Engine appender = io.Open(fname, adios2::Mode::Append);

adios2::Engine appender = io.Open(fname, adios2::Mode::Append);

for (size_t step = NSteps; step < NSteps+ExtraSteps; ++step)
for (size_t step = NSteps; step < NSteps + ExtraSteps; ++step)
{
// Generate test data for each process uniquely
SmallTestData currentTestData =
generateNewSmallTestData(m_TestData, step, mpiRank, mpiSize);

// Retrieve the variables that previously went out of scope
auto var_iString = io.InquireVariable<std::string>("iString");
EXPECT_TRUE(var_iString);
EXPECT_TRUE(var_iString);
auto var_i8 = io.InquireVariable<int8_t>("i8");
EXPECT_TRUE(var_i8);
EXPECT_TRUE(var_i8);
auto var_i16 = io.InquireVariable<int16_t>("i16");
auto var_i32 = io.InquireVariable<int32_t>("i32");
auto var_i64 = io.InquireVariable<int64_t>("i64");
Expand Down Expand Up @@ -218,25 +219,24 @@ TEST_F(AppendTimeStepTest, ADIOS2HDF5WriteAppendRead)
appender.Put(var_r64, currentTestData.R64.data());
appender.EndStep();
}
appender.Close();
appender.Close();
}

{
// Read back
adios2::IO io = adios.DeclareIO("ioRead");
// Read back
adios2::IO io = adios.DeclareIO("ioRead");
if (!engineName.empty())
io.SetEngine(engineName);
else
io.SetEngine(engineName);
else
io.SetEngine("HDF5");
adios2::Engine reader = io.Open(fname, adios2::Mode::Read);
EXPECT_EQ(reader.Steps(), NSteps+ExtraSteps);
reader.Close();

adios2::Engine reader = io.Open(fname, adios2::Mode::Read);
EXPECT_EQ(reader.Steps(), NSteps + ExtraSteps);

reader.Close();
}
}


//******************************************************************************
// main
//******************************************************************************
Expand Down

0 comments on commit e116bb4

Please sign in to comment.