From 09c9f6739c4c8e6bef029d0081cf9227d470da75 Mon Sep 17 00:00:00 2001 From: Jakub Strzebonski Date: Tue, 28 Sep 2021 21:44:41 +0200 Subject: [PATCH] #1565 fix footprinting compilation errors --- src/vt/messaging/active.h | 19 +++++++++++++++++++ src/vt/messaging/async_op_wrapper.h | 8 ++++++++ src/vt/rdma/rdma_info.h | 8 ++++++++ src/vt/trace/trace_log.h | 11 ++++++++++- 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/vt/messaging/active.h b/src/vt/messaging/active.h index e9bbc7abf5..3771dcb512 100644 --- a/src/vt/messaging/active.h +++ b/src/vt/messaging/active.h @@ -187,6 +187,14 @@ struct InProgressIRecv : InProgressBase { return flag; } + /** + * \brief Reconstructor for footprinting + */ + static InProgressIRecv& reconstruct(void* buf) { + auto* ipir = new (buf) InProgressIRecv{nullptr, 0, 0}; + return *ipir; + } + private: MPI_Request req = MPI_REQUEST_NULL; }; @@ -235,6 +243,17 @@ struct InProgressDataIRecv : InProgressBase { | reqs; } + /** + * \brief Reconstructor for footprinting + */ + static InProgressDataIRecv& reconstruct(void* buf) { + auto* ipdir = new (buf) InProgressDataIRecv{ + nullptr, 0, 0, std::vector{}, + nullptr, ActionType{}, ContinuationDeleterType{}, 0 + }; + return *ipdir; + } + void* user_buf = nullptr; ActionType dealloc_user_buf = nullptr; ContinuationDeleterType next = nullptr; diff --git a/src/vt/messaging/async_op_wrapper.h b/src/vt/messaging/async_op_wrapper.h index 484fccc7c6..138acb1291 100644 --- a/src/vt/messaging/async_op_wrapper.h +++ b/src/vt/messaging/async_op_wrapper.h @@ -106,6 +106,14 @@ struct AsyncOpWrapper { s | valid | op_ | tid_; } + /** + * \brief Reconstructor for footprinting + */ + static AsyncOpWrapper& reconstruct(void* buf) { + auto* asyncOpWrapper = new (buf) AsyncOpWrapper{nullptr}; + return *asyncOpWrapper; + } + public: bool valid = false; /**< Whether op is valid */ diff --git a/src/vt/rdma/rdma_info.h b/src/vt/rdma/rdma_info.h index 673a9228ed..11a16104ff 100644 --- a/src/vt/rdma/rdma_info.h +++ b/src/vt/rdma/rdma_info.h @@ -74,6 +74,14 @@ struct Info { offset(in_offset), is_local(in_is_local) { } + /** + * \brief Reconstructor for footprinting + */ + static Info& reconstruct(void* buf) { + auto* info = new (buf) Info{RDMA_TypeType::Uninitialized}; + return *info; + } + template void serialize(Serializer& s) { s | rdma_type diff --git a/src/vt/trace/trace_log.h b/src/vt/trace/trace_log.h index c9973e7aeb..c8fb8e9158 100644 --- a/src/vt/trace/trace_log.h +++ b/src/vt/trace/trace_log.h @@ -236,7 +236,7 @@ struct Log final { } } - // No default constructor. Seems wierd? Copy+move all the way.. + // No default constructor. Seems weird? Copy+move all the way.. // (Copy-constructible and copy-assignable required for dequeue.) Log() = delete; Log(Log const& in) = default; @@ -334,6 +334,15 @@ struct Log final { return data.sys; } + /** + * \brief Reconstructor for footprinting + */ + static Log& reconstruct(void* buf) { + auto* l = new (buf) + Log{0.0, TraceConstantsType::InvalidTraceType, std::string{}, 0}; + return *l; + } + template void serialize(Serializer& s) { s | time