Skip to content
Snippets Groups Projects
Commit 7a5538ee authored by Gregor Weiss's avatar Gregor Weiss Committed by Sergey Lesnik
Browse files

ENH: introduce flushing

- this needs closing and re-opening the file because ADIOS2 does not implement flushing for BP5
https://github.com/ornladios/ADIOS2/issues/3060
parent e670de29
Branches
No related merge requests found
......@@ -23,3 +23,10 @@ void Foam::FileSliceStream::v_access()
enginePtr_ = sliceFile_->createEngine(ioPtr_.get(), paths_.getPathName());
}
void Foam::FileSliceStream::v_flush()
{
Foam::SliceStreamRepo* repo = Foam::SliceStreamRepo::instance();
repo->close();
v_access();
}
......@@ -19,6 +19,8 @@ class FileSliceStream
virtual void v_access() final;
virtual void v_flush() final;
public:
explicit FileSliceStream(std::unique_ptr<StreamFeatures>&);
......
......@@ -370,10 +370,7 @@ void Foam::OFCstreamBase::writeGlobalGeometricField()
if (mode() == SYNC)
{
// sliceStreamPtr->bufferSync(); // ToDoIO rename to "commit"
// ToDoIO introduce "fileSync"
//auto repo = SliceStreamRepo::instance();
//repo->close();
sliceStreamPtr->flush();
}
if (Pstream::master())
......
......@@ -261,4 +261,10 @@ void Foam::SliceStream::put
);
}
void Foam::SliceStream::flush()
{
v_flush();
}
// ************************************************************************* //
......@@ -33,6 +33,8 @@ class SliceStream
{
virtual void v_access() = 0;
virtual void v_flush() = 0;
protected:
// Forward declaration of bridge to implementation
......@@ -148,6 +150,8 @@ public:
void bufferSync();
void flush();
};
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment