Skip to content

Commit

Permalink
Remove usesteps = true/false from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Oct 20, 2023
1 parent fac0006 commit 54e3201
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 109 deletions.
12 changes: 2 additions & 10 deletions test/ParallelIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1687,22 +1687,14 @@ TEST_CASE("append_mode", "[serial]")
{
"adios2":
{
"use_group_table": false,
"engine":
{
"usesteps" : true
}
"use_group_table": false
}
})END";
std::string jsonConfigNew = R"END(
{
"adios2":
{
"use_group_table": true,
"engine":
{
"usesteps" : true
}
"use_group_table": true
}
})END";
if (t == "bp" || t == "bp4" || t == "bp5")
Expand Down
117 changes: 18 additions & 99 deletions test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4323,8 +4323,6 @@ TEST_CASE("adios2_bp5_flush", "[serial][adios2]")
[adios2]
[adios2.engine]
# Check that BP5 can also be used without steps
usesteps = false
type = "bp5"
preferred_flush_target = "disk"
Expand All @@ -4343,7 +4341,6 @@ BufferChunkSize = 2147483646 # 2^31 - 2
[adios2]
[adios2.engine]
usesteps = true
type = "bp5"
preferred_flush_target = "buffer"
Expand All @@ -4361,7 +4358,6 @@ BufferChunkSize = 2147483646 # 2^31 - 2
[adios2]
[adios2.engine]
usesteps = true
type = "bp5"
# preferred_flush_target = <default>
Expand All @@ -4384,7 +4380,6 @@ BufferChunkSize = 2147483646 # 2^31 - 2
[adios2]
[adios2.engine]
usesteps = true
type = "bp5"
preferred_flush_target = "buffer_override"
Expand All @@ -4402,7 +4397,6 @@ BufferChunkSize = 2147483646 # 2^31 - 2
[adios2]
[adios2.engine]
usesteps = true
type = "bp5"
preferred_flush_target = "disk_override"
Expand Down Expand Up @@ -4922,8 +4916,7 @@ this = "should not warn"
void bp4_steps(
std::string const &file,
std::string const &options_write,
std::string const &options_read,
Access access = Access::READ_ONLY)
std::optional<Access> access = Access::READ_ONLY)
{
{
Series writeSeries(file, Access::CREATE, options_write);
Expand All @@ -4943,12 +4936,12 @@ void bp4_steps(
}
}

if (options_read.empty())
if (!access.has_value())
{
return;
}

Series readSeries(file, access, options_read);
Series readSeries(file, *access);

size_t last_iteration_index = 0;
for (auto iteration : readSeries.readIterations())
Expand All @@ -4974,104 +4967,45 @@ void bp4_steps(

TEST_CASE("bp4_steps", "[serial][adios2]")
{
std::string useSteps = R"(
std::string bp4 = R"(
{
"ADIOS2": {
"engine": {
"type": "bp4",
"usesteps": true
"type": "bp4"
}
}
}
)";
std::string nullcore = R"(
{
"adios2": {
"type": "nullcore",
"ENGINE": {
"type": "bp4",
"usesteps": true
}
"type": "nullcore"
}
}
)";
std::string dontUseSteps = R"(
# let's use TOML for this one
[adios2.engine]
type = "bp4"
UseSteps = false
)";

// sing the yes no song
bp4_steps("../samples/bp4steps_yes_yes.bp", useSteps, useSteps);
bp4_steps("../samples/bp4steps_no_yes.bp", dontUseSteps, useSteps);
bp4_steps("../samples/bp4steps_yes_no.bp", useSteps, dontUseSteps);
bp4_steps("../samples/bp4steps_no_no.bp", dontUseSteps, dontUseSteps);
bp4_steps("../samples/nullcore.bp", nullcore, "");
bp4_steps("../samples/bp4steps_default.bp", "{}", "{}");

// bp4_steps(
// "../samples/newlayout_bp4steps_yes_yes.bp",
// useSteps,
// useSteps,
// Access::READ_LINEAR);
// bp4_steps(
// "../samples/newlayout_bp4steps_yes_no.bp",
// useSteps,
// dontUseSteps,
// Access::READ_LINEAR);
bp4_steps("../samples/bp4steps.bp", bp4);
bp4_steps("../samples/bp4steps.bp", bp4, Access::READ_LINEAR);
bp4_steps("../samples/nullcore.bp", nullcore, std::nullopt);
bp4_steps("../samples/bp4steps_default.bp", "{}");

#if openPMD_HAS_ADIOS_2_9
/*
* Do this whole thing once more, but this time use the new attribute
* layout.
*/
useSteps = R"(
{
"adios2": {
"use_group_table": true,
"engine": {
"type": "bp4",
"usesteps": true
}
}
}
)";
dontUseSteps = R"(
bp4 = R"(
{
"adios2": {
"use_group_table": true,
"engine": {
"type": "bp4",
"usesteps": false
"type": "bp4"
}
}
}
)";
// sing the yes no song
bp4_steps(
"../samples/newlayout_bp4steps_yes_yes.bp",
useSteps,
useSteps,
Access::READ_LINEAR);
bp4_steps("../samples/newlayout_bp4steps_yes_yes.bp", useSteps, useSteps);
bp4_steps(
"../samples/newlayout_bp4steps_yes_no.bp", useSteps, dontUseSteps);
bp4_steps(
"../samples/newlayout_bp4steps_no_yes.bp", dontUseSteps, useSteps);
bp4_steps(
"../samples/newlayout_bp4steps_no_no.bp", dontUseSteps, dontUseSteps);

bp4_steps(
"../samples/newlayout_bp4steps_yes_yes.bp",
useSteps,
useSteps,
Access::READ_LINEAR);
bp4_steps(
"../samples/newlayout_bp4steps_yes_no.bp",
useSteps,
dontUseSteps,
Access::READ_LINEAR);
bp4_steps("../samples/newlayout_bp4steps.bp", bp4, Access::READ_LINEAR);
bp4_steps("../samples/newlayout_bp4steps.bp", bp4);
#endif
}
#endif
Expand Down Expand Up @@ -6539,10 +6473,7 @@ void chaotic_stream(std::string filename, bool variableBased)
std::string jsonConfig = R"(
{
"adios2": {
"use_group_table": true,
"engine": {
"usesteps": true
}
"use_group_table": true
}
})";

Expand Down Expand Up @@ -7211,22 +7142,14 @@ TEST_CASE("append_mode", "[serial]")
{
"adios2":
{
"use_group_table": false,
"engine":
{
"usesteps" : true
}
"use_group_table": false
}
})END";
std::string jsonConfigNew = R"END(
{
"adios2":
{
"use_group_table": true,
"engine":
{
"usesteps" : true
}
"use_group_table": true
}
})END";
if (t == "bp" || t == "bp4" || t == "bp5")
Expand Down Expand Up @@ -7273,11 +7196,7 @@ void append_mode_filebased(std::string const &extension)
{
"adios2":
{
"use_group_table": true,
"engine":
{
"usesteps" : true
}
"use_group_table": true
}
})END";
auto writeSomeIterations = [](WriteIterations &&writeIterations,
Expand Down

0 comments on commit 54e3201

Please sign in to comment.