From ee890a7a466f0c79b50adb00191ee5a387f7a10f Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Tue, 26 Feb 2019 17:08:53 +0100 Subject: [PATCH] Implement Reset signal --- fairmq/ofi/Context.cxx | 6 +++++- fairmq/ofi/Context.h | 1 + fairmq/ofi/TransportFactory.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fairmq/ofi/Context.cxx b/fairmq/ofi/Context.cxx index 964af84e..d8db08f6 100644 --- a/fairmq/ofi/Context.cxx +++ b/fairmq/ofi/Context.cxx @@ -54,9 +54,13 @@ auto Context::InitThreadPool(int numberIoThreads) -> void } } -Context::~Context() +auto Context::Reset() -> void { fIoContext.stop(); +} + +Context::~Context() +{ for (auto& thread : fThreadPool) thread.join(); } diff --git a/fairmq/ofi/Context.h b/fairmq/ofi/Context.h index 90a91d8c..3f3f4ed0 100644 --- a/fairmq/ofi/Context.h +++ b/fairmq/ofi/Context.h @@ -69,6 +69,7 @@ class Context static auto VerifyAddress(const std::string& address) -> Address; auto Interrupt() -> void { LOG(debug) << "OFI transport: Interrupted (NOOP - not implemented)."; } auto Resume() -> void { LOG(debug) << "OFI transport: Resumed (NOOP - not implemented)."; } + auto Reset() -> void; auto MakeReceiveMessage(size_t size) -> MessagePtr; auto MakeSendMessage(size_t size) -> MessagePtr; diff --git a/fairmq/ofi/TransportFactory.h b/fairmq/ofi/TransportFactory.h index 3a3a8d45..ca9f9641 100644 --- a/fairmq/ofi/TransportFactory.h +++ b/fairmq/ofi/TransportFactory.h @@ -52,7 +52,7 @@ class TransportFactory final : public FairMQTransportFactory void Interrupt() override { fContext.Interrupt(); } void Resume() override { fContext.Resume(); } - void Reset() override {} + void Reset() override { fContext.Reset(); } private: mutable Context fContext;