Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow an inline writer to be created and used without an inline reader #3287

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions source/adios2/engine/inline/InlineWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@ InlineWriter::InlineWriter(IO &io, const std::string &name, const Mode mode,
const InlineReader *InlineWriter::GetReader() const
{
const auto &engine_map = m_IO.GetEngines();
if (engine_map.size() != 2)
if (engine_map.size() == 1)
{
// it should be fine for a writer to be created and start running,
// without the reader having been created. This is necessary to run
// correctly with ParaView Catalyst Live.
return nullptr;
}
else if (engine_map.size() > 2)
{
helper::Throw<std::runtime_error>(
"Engine", "InlineWriter", "GetReader",
"There must be exactly one reader and one "
"writer for the inline engine.");
"There must be only one inline writer and at most "
"one inline reader.");
}

std::shared_ptr<Engine> e = engine_map.begin()->second;
Expand Down Expand Up @@ -77,7 +84,7 @@ StepStatus InlineWriter::BeginStep(StepMode mode, const float timeoutSeconds)
}

auto reader = GetReader();
if (reader->IsInsideStep())
if (reader && reader->IsInsideStep())
{
m_InsideStep = false;
return StepStatus::NotReady;
Expand Down