From ba582cb60355877f0a1866453d1a345f704cb610 Mon Sep 17 00:00:00 2001 From: niranda perera Date: Fri, 18 Mar 2022 12:24:27 -0400 Subject: [PATCH 1/3] `gatherv.h` header was missing in include --- gloo/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/gloo/CMakeLists.txt b/gloo/CMakeLists.txt index 02124e904..9716011c7 100644 --- a/gloo/CMakeLists.txt +++ b/gloo/CMakeLists.txt @@ -43,6 +43,7 @@ list(APPEND GLOO_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/broadcast_one_to_all.h" "${CMAKE_CURRENT_SOURCE_DIR}/context.h" "${CMAKE_CURRENT_SOURCE_DIR}/gather.h" + "${CMAKE_CURRENT_SOURCE_DIR}/gatherv.h" "${CMAKE_CURRENT_SOURCE_DIR}/math.h" "${CMAKE_CURRENT_SOURCE_DIR}/pairwise_exchange.h" "${CMAKE_CURRENT_SOURCE_DIR}/reduce.h" From c49f9d955b73a920aebbe67ad6fe4b392d9523d2 Mon Sep 17 00:00:00 2001 From: niranda Date: Wed, 30 Mar 2022 00:24:30 -0400 Subject: [PATCH 2/3] addint testRecv and testSend --- gloo/transport/tcp/unbound_buffer.cc | 6 ++++++ gloo/transport/tcp/unbound_buffer.h | 3 +++ gloo/transport/unbound_buffer.cc | 7 +++++++ gloo/transport/unbound_buffer.h | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/gloo/transport/tcp/unbound_buffer.cc b/gloo/transport/tcp/unbound_buffer.cc index fc8fb559b..fc12ed554 100644 --- a/gloo/transport/tcp/unbound_buffer.cc +++ b/gloo/transport/tcp/unbound_buffer.cc @@ -203,6 +203,12 @@ void UnboundBuffer::throwIfException() { std::rethrow_exception(ex_); } } +bool UnboundBuffer::testRecv() { + return recvCompletions_ != 0; +} +bool UnboundBuffer::testSend() { + return sendCompletions_ != 0; +} } // namespace tcp } // namespace transport diff --git a/gloo/transport/tcp/unbound_buffer.h b/gloo/transport/tcp/unbound_buffer.h index e4ad92c63..53d31fc6c 100644 --- a/gloo/transport/tcp/unbound_buffer.h +++ b/gloo/transport/tcp/unbound_buffer.h @@ -61,6 +61,9 @@ class UnboundBuffer : public ::gloo::transport::UnboundBuffer { void handleRecvCompletion(int rank); void handleSendCompletion(int rank); + bool testRecv() override; + bool testSend() override; + protected: std::shared_ptr context_; diff --git a/gloo/transport/unbound_buffer.cc b/gloo/transport/unbound_buffer.cc index cdd9aa0ad..727d5fe0e 100644 --- a/gloo/transport/unbound_buffer.cc +++ b/gloo/transport/unbound_buffer.cc @@ -6,6 +6,7 @@ * LICENSE file in the root directory of this source tree. */ +#include #include "gloo/transport/unbound_buffer.h" namespace gloo { @@ -13,6 +14,12 @@ namespace transport { // Have to provide implementation for pure virtual destructor. UnboundBuffer::~UnboundBuffer() {} +bool UnboundBuffer::testRecv() { + abort(); +} +bool UnboundBuffer::testSend() { + abort(); +} } // namespace transport } // namespace gloo diff --git a/gloo/transport/unbound_buffer.h b/gloo/transport/unbound_buffer.h index b21b5b3a0..1704b8c7d 100644 --- a/gloo/transport/unbound_buffer.h +++ b/gloo/transport/unbound_buffer.h @@ -117,6 +117,10 @@ class UnboundBuffer { uint64_t slot, size_t offset = 0, size_t nbytes = kUnspecifiedByteCount) = 0; + + virtual bool testRecv(); + + virtual bool testSend(); }; } // namespace transport From b19f9e99de273f42aa336286c09e9ca2393061e9 Mon Sep 17 00:00:00 2001 From: niranda Date: Wed, 30 Mar 2022 00:27:24 -0400 Subject: [PATCH 3/3] adding comments --- gloo/transport/unbound_buffer.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gloo/transport/unbound_buffer.h b/gloo/transport/unbound_buffer.h index 1704b8c7d..5f9f3143e 100644 --- a/gloo/transport/unbound_buffer.h +++ b/gloo/transport/unbound_buffer.h @@ -118,8 +118,12 @@ class UnboundBuffer { size_t offset = 0, size_t nbytes = kUnspecifiedByteCount) = 0; + // Tests if a reception is possibly complete. Only valid if called after + // `recv` and before `waitRecv` virtual bool testRecv(); + // Tests if a sending is possibly complete. Only valid if called after + // `send` and before `waitSend` virtual bool testSend(); };