diff --git a/fairmq/SDK.h b/fairmq/SDK.h index a46d865b..c2e626d2 100644 --- a/fairmq/SDK.h +++ b/fairmq/SDK.h @@ -13,6 +13,7 @@ #include #include #include +#include #include // IWYU pragma: end_exports diff --git a/fairmq/sdk/DDSTopology.cxx b/fairmq/sdk/DDSTopology.cxx index 030cb9bc..7c5515f4 100644 --- a/fairmq/sdk/DDSTopology.cxx +++ b/fairmq/sdk/DDSTopology.cxx @@ -8,6 +8,8 @@ #include "DDSTopology.h" +#include + #include #include @@ -29,14 +31,12 @@ struct DDSTopology::Impl explicit Impl(Path topoFile, DDSEnvironment env) : fEnv(std::move(env)) , fTopoFile(std::move(topoFile)) - , fTopo(nullptr) - { - LOG(warn) << topoFile; - } + , fTopo(fTopoFile.string()) + {} DDSEnvironment fEnv; Path fTopoFile; - std::unique_ptr fTopo; + dds::topology_api::CTopology fTopo; }; DDSTopology::DDSTopology(Path topoFile, DDSEnvironment env) @@ -54,20 +54,15 @@ auto DDSTopology::GetTopoFile() const -> Path return file; } -void DDSTopology::CreateTopology(Path topoFile) -{ - fImpl->fTopo = tools::make_unique(fImpl->fTopoFile.c_str()); -} - int DDSTopology::GetNumRequiredAgents() { - return fImpl->fTopo->getRequiredNofAgents(); + return fImpl->fTopo.getRequiredNofAgents(); } std::vector DDSTopology::GetDeviceList() { std::vector taskIDs; - taskIDs.reserve(fImpl->fTopo->getRequiredNofAgents()); + taskIDs.reserve(GetNumRequiredAgents()); // TODO make sure returned tasks are actually devices dds::topology_api::STopoRuntimeTask::FilterIteratorPair_t taskIt = fImpl->fTopo->getRuntimeTaskIterator([](const dds::topology_api::STopoRuntimeTask::FilterIterator_t::value_type& value) -> bool { diff --git a/fairmq/sdk/DDSTopology.h b/fairmq/sdk/DDSTopology.h index dc37c099..635094eb 100644 --- a/fairmq/sdk/DDSTopology.h +++ b/fairmq/sdk/DDSTopology.h @@ -41,8 +41,6 @@ class DDSTopology /// @throw std::runtime_error auto GetTopoFile() const -> Path; - void CreateTopology(Path); - /// @brief Get number of required agents for this topology int GetNumRequiredAgents(); diff --git a/fairmq/sdk/Topology.cxx b/fairmq/sdk/Topology.cxx index 69fef3ca..98de02bb 100644 --- a/fairmq/sdk/Topology.cxx +++ b/fairmq/sdk/Topology.cxx @@ -61,8 +61,6 @@ Topology::Topology(DDSTopology topo, DDSSession session) , fExecutionThread() , fShutdown(false) { - fDDSTopo.CreateTopology(fDDSTopo.GetTopoFile()); - std::vector deviceList = fDDSTopo.GetDeviceList(); for (const auto& d : deviceList) { LOG(info) << "fair::mq::Topology Adding device " << d;