@@ -4307,7 +4307,6 @@ enum class FlushDuringStep : std::uint8_t
43074307
43084308void adios2_bp5_flush (std::string const &cfg, FlushDuringStep flushDuringStep)
43094309{
4310- return ;
43114310 constexpr size_t size = size_t (1024 ) * 1024 ;
43124311
43134312 auto getsize = []() {
@@ -4352,6 +4351,7 @@ void adios2_bp5_flush(std::string const &cfg, FlushDuringStep flushDuringStep)
43524351 Datatype dtype = determineDatatype<int32_t >();
43534352 {
43544353 Series write (" ../samples/bp5_flush.bp" , Access::CREATE_LINEAR, cfg);
4354+ bool flushImmediately = write.flushImmediately ();
43554355
43564356 {
43574357 auto component =
@@ -4388,8 +4388,16 @@ void adios2_bp5_flush(std::string const &cfg, FlushDuringStep flushDuringStep)
43884388 if (flushDuringStep == FlushDuringStep::Default_Yes ||
43894389 flushDuringStep == FlushDuringStep::Always)
43904390 {
4391- // should still be roughly within 1% of 4Mb
4392- REQUIRE (std::abs (1 - double (currentSize) / (4 * size)) <= 0.01 );
4391+ if (flushImmediately)
4392+ {
4393+ // should still be roughly within 1% of 8Mb
4394+ REQUIRE (std::abs (1 - double (currentSize) / (8 * size)) <= 0.01 );
4395+ }
4396+ else
4397+ {
4398+ // should still be roughly within 1% of 4Mb
4399+ REQUIRE (std::abs (1 - double (currentSize) / (4 * size)) <= 0.01 );
4400+ }
43934401 }
43944402 else
43954403 {
@@ -4429,8 +4437,17 @@ void adios2_bp5_flush(std::string const &cfg, FlushDuringStep flushDuringStep)
44294437 }
44304438 else if (flushDuringStep == FlushDuringStep::Default_Yes)
44314439 {
4432- // should now be roughly within 1% of 8Mb
4433- REQUIRE (std::abs (1 - double (currentSize) / (8 * size)) <= 0.01 );
4440+ if (flushImmediately)
4441+ {
4442+ // should now be roughly within 1% of 12Mb
4443+ REQUIRE (
4444+ std::abs (1 - double (currentSize) / (12 * size)) <= 0.01 );
4445+ }
4446+ else
4447+ {
4448+ // should now be roughly within 1% of 8Mb
4449+ REQUIRE (std::abs (1 - double (currentSize) / (8 * size)) <= 0.01 );
4450+ }
44344451 }
44354452 else
44364453 {
0 commit comments