From dfc6b5c4a35c499c02663b7e1d6db5a917a189b0 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Thu, 7 Feb 2019 04:02:45 +0100 Subject: [PATCH] Add pmix::fence() C++ binding --- fairmq/plugins/PMIx/PMIx.hpp | 11 +++++++++++ fairmq/plugins/PMIx/PMIxPlugin.cxx | 11 ++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/fairmq/plugins/PMIx/PMIx.hpp b/fairmq/plugins/PMIx/PMIx.hpp index cbebdb45..60417e58 100644 --- a/fairmq/plugins/PMIx/PMIx.hpp +++ b/fairmq/plugins/PMIx/PMIx.hpp @@ -173,6 +173,17 @@ auto publish(const std::vector& info) -> void } } +auto fence(const std::vector& procs = {}, const std::vector& info = {}) -> void +{ + status rc; + + rc = PMIx_Fence(procs.data(), procs.size(), info.data(), info.size()); + if (rc != PMIX_SUCCESS) { + throw runtime_error("pmix::fence() failed: rc=" + rc); + } +} + + } /* namespace pmix */ #endif /* PMIX_HPP */ diff --git a/fairmq/plugins/PMIx/PMIxPlugin.cxx b/fairmq/plugins/PMIx/PMIxPlugin.cxx index 7393a534..d68b0037 100644 --- a/fairmq/plugins/PMIx/PMIxPlugin.cxx +++ b/fairmq/plugins/PMIx/PMIxPlugin.cxx @@ -40,13 +40,14 @@ PMIxPlugin::PMIxPlugin(const std::string& name, PublishBoundChannels(); - // pmix_proc_t proc; - // rc = PMIx_Fence(&proc, 1, NULL, 0) - // fence + { + pmix::proc all(fProc); + all.rank = pmix::rank::wildcard; + + pmix::fence({all}); + } // lookup - - // fence break; case DeviceState::Exiting: UnsubscribeFromDeviceStateChange();