Skip to content

Commit

Permalink
Always run each instance with it's own unique copy of the iterator wr…
Browse files Browse the repository at this point in the history
…apper
  • Loading branch information
dagardner-nv committed Aug 29, 2024
1 parent cafdfb3 commit 4dbef0d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/mrc/_pymrc/src/segment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,15 @@ std::shared_ptr<mrc::segment::ObjectProperties> build_source(mrc::segment::IBuil
const std::string& name,
PyIteratorWrapper iter_wrapper)
{
auto wrapper = [iter_wrapper = std::move(iter_wrapper)](PyObjectSubscriber& subscriber) mutable {
auto wrapper = [src_iter_wrapper = std::move(iter_wrapper)](PyObjectSubscriber& subscriber) mutable {
auto& ctx = runnable::Context::get_runtime_context();

DVLOG(10) << ctx.info() << " Starting source";

bool received_stop_iteration = false;
// Taking a copy, if the source has pe_count>1 or engines_per_pe>1 we will need an indepdenent copy of the
// iterator wrapper
PyIteratorWrapper iter_wrapper = src_iter_wrapper;
bool received_stop_iteration = false;
while (!received_stop_iteration && subscriber.is_subscribed())
{
try
Expand Down

0 comments on commit 4dbef0d

Please sign in to comment.