Skip to content

Commit

Permalink
Update the testing code to the new API
Browse files Browse the repository at this point in the history
  • Loading branch information
anagainaru committed Dec 1, 2022
1 parent 9f892c3 commit 605c660
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions testing/adios2/engine/bp/TestBPWriteReadSCR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR1D)
{
io.SetParameter("ProfileUnits", "Microseconds");
io.SetParameters("Threads=2, CollectiveMetadata = OFF");
io.SetParameters({{"UseSCR", "1"}});
adios2::Params parameters = io.Parameters();

auto ProfileUnits = parameters.find("ProfileUnits");
Expand Down Expand Up @@ -134,8 +135,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR1D)

io.AddTransport("file");

int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

EXPECT_EQ(bpWriter.OpenMode(), adios2::Mode::Write);
Expand Down Expand Up @@ -203,7 +202,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR1D)

// Close the file
bpWriter.Close();
SCR_Complete_output(scr_valid);
}

{
Expand All @@ -218,8 +216,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR1D)
io.SetParameters(engineParameters);
}

int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpReader =
io.Open(fname, adios2::Mode::ReadRandomAccess);

Expand Down Expand Up @@ -392,7 +388,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR1D)
}
}
bpReader.Close();
SCR_Complete_output(scr_valid);
}
}

Expand Down Expand Up @@ -459,6 +454,7 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR2D)
EXPECT_TRUE(var_r64);
}

io.SetParameters({{"UseSCR", "1"}});
if (!engineName.empty())
{
io.SetEngine(engineName);
Expand All @@ -474,8 +470,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR2D)
}
io.AddTransport("file");

int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

for (size_t step = 0; step < NSteps; ++step)
Expand Down Expand Up @@ -533,7 +527,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR2D)

// Close the file
bpWriter.Close();
SCR_Complete_output(scr_valid);
}

{
Expand All @@ -548,8 +541,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR2D)
io.SetParameters(engineParameters);
}

int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpReader =
io.Open(fname, adios2::Mode::ReadRandomAccess);

Expand Down Expand Up @@ -716,7 +707,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR2D)
}
}
bpReader.Close();
SCR_Complete_output(scr_valid);
}
}

Expand Down Expand Up @@ -757,6 +747,7 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR10)
EXPECT_TRUE(var_c64);
}

io.SetParameters({{"UseSCR", "1"}});
if (!engineName.empty())
{
io.SetEngine(engineName);
Expand All @@ -773,8 +764,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR10)

io.AddTransport("file");

int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

for (size_t step = 0; step < NSteps; ++step)
Expand Down Expand Up @@ -812,7 +801,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR10)

// Close the file
bpWriter.Close();
SCR_Complete_output(scr_valid);
}

{
Expand All @@ -827,8 +815,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR10)
io.SetParameters(engineParameters);
}

int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpReader =
io.Open(fname, adios2::Mode::ReadRandomAccess);

Expand Down Expand Up @@ -902,7 +888,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCR10)
}
}
bpReader.Close();
SCR_Complete_output(scr_valid);
}
}

Expand Down Expand Up @@ -933,6 +918,7 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCRDeferred)
auto var_2d_i32 =
io.DefineVariable<int32_t>("i32_2d", shape_2d, start_2d, count_2d);

io.SetParameters({{"UseSCR", "1"}});
if (!engineName.empty())
{
io.SetEngine(engineName);
Expand All @@ -942,8 +928,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCRDeferred)
io.SetEngine("BPFile");
}
io.AddTransport("file");
int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write);

for (size_t step = 0; step < NSteps; ++step)
Expand All @@ -967,7 +951,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCRDeferred)
}

bpWriter.Close();
SCR_Complete_output(scr_valid);
}

{
Expand All @@ -977,8 +960,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCRDeferred)
{
io.SetEngine(engineName);
}
int scr_valid = 1;
SCR_Start_output(fname.c_str(), SCR_FLAG_CHECKPOINT);
adios2::Engine bpReader =
io.Open(fname, adios2::Mode::ReadRandomAccess);

Expand Down Expand Up @@ -1030,7 +1011,6 @@ TEST_F(BPWriteReadTestSCR, ADIOS2BPWriteReadSCRDeferred)
}
}
bpReader.Close();
SCR_Complete_output(scr_valid);
}
}

Expand Down

0 comments on commit 605c660

Please sign in to comment.