Skip to content

Commit

Permalink
#1565 fix footprinting compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Strzebonski committed Sep 28, 2021
1 parent 7c9c916 commit 392410b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
19 changes: 19 additions & 0 deletions src/vt/messaging/active.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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<MPI_Request>{},
nullptr, ActionType{}, ContinuationDeleterType{}, 0
};
return *ipdir;
}

void* user_buf = nullptr;
ActionType dealloc_user_buf = nullptr;
ContinuationDeleterType next = nullptr;
Expand Down
8 changes: 8 additions & 0 deletions src/vt/messaging/async_op_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
6 changes: 3 additions & 3 deletions src/vt/messaging/message/smart_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ struct MsgSharedPtr final {
}

/// [obsolete] Use to() as MsgVirtualPtr <-> MsgSharedPtr.
/// Both methods are equivalent in funciton.
/// Both methods are equivalent in function.
template <typename U>
MsgSharedPtr<U> toVirtual() const {
return to<U>();
Expand Down Expand Up @@ -307,7 +307,7 @@ struct MsgSharedPtr final {
/**
* \brief Helper to unify 'stealing' message ownership.
*
* This type is not intented to be used directly. It uses implicit conversion
* This type is not intended to be used directly. It uses implicit conversion
* construtors to perform a 'std::move' on a \c MsgPtr<MsgT>&.
*
* If a normal \c MsgT* is supplied, it is promoted without stealing.
Expand Down Expand Up @@ -376,7 +376,7 @@ using MsgSharedPtr = messaging::MsgSharedPtr<T>;
* \brief Wrapper to manage Active Messages.
*
* A MsgPtr represents a 'shared pointer like' object wrapping a
* message that correcly manages reference-counts to order to
* message that correctly manages reference-counts to order to
* eliminate memory leaks.
*/
template <typename T>
Expand Down
8 changes: 8 additions & 0 deletions src/vt/rdma/rdma_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename Serializer>
void serialize(Serializer& s) {
s | rdma_type
Expand Down
11 changes: 10 additions & 1 deletion src/vt/trace/trace_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 <typename Serializer>
void serialize(Serializer& s) {
s | time
Expand Down

0 comments on commit 392410b

Please sign in to comment.