diff --git a/fairmq/shmem/Manager.h b/fairmq/shmem/Manager.h index e35b7cb6..a9ec1c2d 100644 --- a/fairmq/shmem/Manager.h +++ b/fairmq/shmem/Manager.h @@ -415,10 +415,10 @@ class Manager while (fRegionEventsSubscriptionActive) { auto infos = GetRegionInfoUnsafe(); for (const auto& i : infos) { - auto el = fObservedRegionEvents.find(i.id); + auto el = fObservedRegionEvents.find({i.id, i.managed}); if (el == fObservedRegionEvents.end()) { fRegionEventCallback(i); - fObservedRegionEvents.emplace(i.id, i.event); + fObservedRegionEvents.emplace(std::make_pair(i.id, i.managed), i.event); } else { if (el->second == RegionEvent::created && i.event == RegionEvent::destroyed) { fRegionEventCallback(i); @@ -617,7 +617,7 @@ class Manager std::thread fRegionEventThread; bool fRegionEventsSubscriptionActive; std::function fRegionEventCallback; - std::unordered_map fObservedRegionEvents; + std::map, RegionEvent> fObservedRegionEvents; DeviceCounter* fDeviceCounter; Uint16SegmentInfoHashMap* fShmSegments; diff --git a/test/region/_region.cxx b/test/region/_region.cxx index ab2e6201..80708256 100644 --- a/test/region/_region.cxx +++ b/test/region/_region.cxx @@ -50,12 +50,12 @@ void RegionEventSubscriptions(const string& transport) ASSERT_EQ(factory->SubscribedToRegionEvents(), false); factory->SubscribeToRegionEvents([&](FairMQRegionInfo info) { - LOG(warn) << ">>>" << info.event; - LOG(warn) << "managed: " << info.managed; - LOG(warn) << "id: " << info.id; - LOG(warn) << "ptr: " << info.ptr; - LOG(warn) << "size: " << info.size; - LOG(warn) << "flags: " << info.flags; + LOG(info) << ">>> " << info.event << ": " + << (info.managed ? "managed" : "unmanaged") + << ", id: " << info.id + << ", ptr: " << info.ptr + << ", size: " << info.size + << ", flags: " << info.flags; if (info.event == FairMQRegionEvent::created) { if (info.id == id1) { ASSERT_EQ(info.size, size1);