Skip to content

Commit 62a70c4

Browse files
Ensure IO for write goes out of scope before read
1 parent 38fb601 commit 62a70c4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

testing/adios2/engine/bp/TestBPDataSizeAggregate.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,17 @@ TEST_F(DSATest, TestWriteUnbalancedData)
9494
uint64_t globalNy = sumFirstN(rankDataSizes, rankDataSizes.size());
9595
uint64_t largestValue = (globalNx * globalNy) - 1;
9696

97-
adios2::IO bpIO = adios.DeclareIO("WriteIO");
98-
bpIO.SetEngine("BPFile");
99-
bpIO.SetParameter("AggregationType", aggregationType);
100-
bpIO.SetParameter("NumSubFiles", numberOfSubFiles);
101-
bpIO.SetParameter("verbose", verbose);
102-
10397
{
98+
adios2::IO bpIO = adios.DeclareIO("WriteIO");
99+
bpIO.SetEngine("BPFile");
100+
bpIO.SetParameter("AggregationType", aggregationType);
101+
bpIO.SetParameter("NumSubFiles", numberOfSubFiles);
102+
bpIO.SetParameter("verbose", verbose);
103+
104104
adios2::Variable<uint64_t> varGlobalArray =
105105
bpIO.DefineVariable<uint64_t>("GlobalArray", {globalNx, globalNy});
106106
EXPECT_TRUE(varGlobalArray);
107-
}
108107

109-
{
110108
adios2::Engine bpWriter = bpIO.Open("unbalanced_output.bp", adios2::Mode::Write);
111109

112110
for (size_t step = 0; step < nSteps; ++step)

0 commit comments

Comments
 (0)