@@ -4306,7 +4306,6 @@ enum class FlushDuringStep : std::uint8_t
43064306
43074307void adios2_bp5_flush (std::string const &cfg, FlushDuringStep flushDuringStep)
43084308{
4309- return ;
43104309 constexpr size_t size = size_t (1024 ) * 1024 ;
43114310
43124311 auto getsize = []() {
@@ -4351,6 +4350,7 @@ void adios2_bp5_flush(std::string const &cfg, FlushDuringStep flushDuringStep)
43514350 Datatype dtype = determineDatatype<int32_t >();
43524351 {
43534352 Series write (" ../samples/bp5_flush.bp" , Access::CREATE_LINEAR, cfg);
4353+ bool flushImmediately = write.flushImmediately ();
43544354
43554355 {
43564356 auto component =
@@ -4387,8 +4387,16 @@ void adios2_bp5_flush(std::string const &cfg, FlushDuringStep flushDuringStep)
43874387 if (flushDuringStep == FlushDuringStep::Default_Yes ||
43884388 flushDuringStep == FlushDuringStep::Always)
43894389 {
4390- // should still be roughly within 1% of 4Mb
4391- REQUIRE (std::abs (1 - double (currentSize) / (4 * size)) <= 0.01 );
4390+ if (flushImmediately)
4391+ {
4392+ // should still be roughly within 1% of 8Mb
4393+ REQUIRE (std::abs (1 - double (currentSize) / (8 * size)) <= 0.01 );
4394+ }
4395+ else
4396+ {
4397+ // should still be roughly within 1% of 4Mb
4398+ REQUIRE (std::abs (1 - double (currentSize) / (4 * size)) <= 0.01 );
4399+ }
43924400 }
43934401 else
43944402 {
@@ -4428,8 +4436,17 @@ void adios2_bp5_flush(std::string const &cfg, FlushDuringStep flushDuringStep)
44284436 }
44294437 else if (flushDuringStep == FlushDuringStep::Default_Yes)
44304438 {
4431- // should now be roughly within 1% of 8Mb
4432- REQUIRE (std::abs (1 - double (currentSize) / (8 * size)) <= 0.01 );
4439+ if (flushImmediately)
4440+ {
4441+ // should now be roughly within 1% of 12Mb
4442+ REQUIRE (
4443+ std::abs (1 - double (currentSize) / (12 * size)) <= 0.01 );
4444+ }
4445+ else
4446+ {
4447+ // should now be roughly within 1% of 8Mb
4448+ REQUIRE (std::abs (1 - double (currentSize) / (8 * size)) <= 0.01 );
4449+ }
44334450 }
44344451 else
44354452 {
0 commit comments