Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1258: add missing fields in 'serialize' methods #1263

Merged
merged 12 commits into from
Feb 25, 2021
8 changes: 8 additions & 0 deletions src/vt/configs/arguments/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,14 @@ struct AppConfig {
| vt_term_rooted_use_wave
| vt_hang_freq

| vt_diag_enable
| vt_diag_print_summary
| vt_diag_summary_csv_file
| vt_diag_summary_file
| vt_diag_csv_base_units

| vt_pause
| vt_max_mpi_send_size

| vt_debug_all
| vt_debug_verbose
Expand Down Expand Up @@ -336,6 +343,7 @@ struct AppConfig {
| vt_debug_group
| vt_debug_broadcast
| vt_debug_objgroup
| vt_debug_phase

| vt_debug_print_flush

Expand Down
15 changes: 14 additions & 1 deletion src/vt/messaging/active.h
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,20 @@ struct ActiveMessenger : runtime::component::PollableComponent<ActiveMessenger>
| in_progress_active_msg_irecv
| in_progress_data_irecv
| in_progress_ops
| this_node_;
| this_node_
| amForwardCounterGauge
| amHandlerCount
| amPollCount
| amPostedCounterGauge
| amRecvCounterGauge
| amSentCounterGauge
| bcastsSentCount
| dmPollCount
| dmPostedCounterGauge
| dmRecvCounterGauge
| dmSentCounterGauge
| tdRecvCount
| tdSentCount;

# if vt_check_enabled(trace_enabled)
s | current_trace_context_
Expand Down
4 changes: 4 additions & 0 deletions src/vt/messaging/message/smart_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ struct MsgSharedPtr final {
auto ptr = get();
auto const msg_size = vt::serialization::MsgSizer<MsgType>::get(ptr);
s.addBytes(msg_size);

// skip footprinting of members, we rely on message size estimate instead
s.skip(impl_);
s.skip(ptr_);
}
}

Expand Down
31 changes: 19 additions & 12 deletions src/vt/pipe/callback/cb_union/cb_raw.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,37 +219,44 @@ struct GeneralCallback {

template <typename SerializerT>
void serialize(SerializerT& s) {
using EnumDataType = typename std::underlying_type<CallbackEnum>::type;
EnumDataType val = static_cast<EnumDataType>(active_);
s | val;
active_ = static_cast<CallbackEnum>(val);
s | active_;

// serialize actual content of the union and account for leftovers and
// padding bytes when footprinting
auto union_size = sizeof(this->u_);
auto ser = [&](auto& cb){
s | cb;
s.addBytes(union_size - sizeof(cb));
};
s.skip(u_);
switch (active_) {
case CallbackEnum::AnonCB:
s | u_.anon_cb_;
ser(u_.anon_cb_);
break;
case CallbackEnum::SendMsgCB:
s | u_.send_msg_cb_;
ser(u_.send_msg_cb_);
break;
case CallbackEnum::SendColMsgCB:
s | u_.send_col_msg_cb_;
ser(u_.send_col_msg_cb_);
break;
case CallbackEnum::BcastMsgCB:
s | u_.bcast_msg_cb_;
ser(u_.bcast_msg_cb_);
break;
case CallbackEnum::BcastColMsgCB:
s | u_.bcast_col_msg_cb_;
ser(u_.bcast_col_msg_cb_);
break;
case CallbackEnum::BcastColDirCB:
s | u_.bcast_col_dir_cb_;
ser(u_.bcast_col_dir_cb_);
break;
case CallbackEnum::BcastObjGrpCB:
s | u_.bcast_obj_cb_;
ser(u_.bcast_obj_cb_);
break;
case CallbackEnum::SendObjGrpCB:
s | u_.send_obj_cb_;
ser(u_.send_obj_cb_);
break;
case CallbackEnum::NoCB:
// Serializing empty callback!
s.addBytes(sizeof(u_) - sizeof(active_));
break;
default:
vtAssert(0, "Should be unreachable");
Expand Down
2 changes: 2 additions & 0 deletions src/vt/pipe/signal/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct Signal : SignalBase {
template <typename SerializerT>
void serialize(SerializerT& s) {
s | signal_tag_;

s.skip(data_ptr_);
}

public:
Expand Down
15 changes: 8 additions & 7 deletions src/vt/rdma/state/rdma_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,14 @@ struct State {
| get_tag_holder
| put_tag_holder
| pending_tag_gets
| pending_tag_puts;

s.countBytes(user_state_get_msg_);
s.countBytes(user_state_put_msg_);

s.countBytes(rdma_get_fn);
s.countBytes(rdma_put_fn);
| pending_tag_puts
| user_state_get_msg_
| user_state_put_msg_
| rdma_get_fn
| rdma_put_fn
| no_rdma_handle
| no_rdma_ptr
| no_byte;
}

bool using_default_put_handler = false;
Expand Down
4 changes: 4 additions & 0 deletions src/vt/rdmahandle/base_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ struct BaseTypedHandle : BaseHandle {
void serialize(SerializerT& s) {
s | count_;
s | hoff_;

s.skip(actions_);
s.skip(lock_);
s.skip(user_buffer_);
}

protected:
Expand Down
5 changes: 2 additions & 3 deletions src/vt/rdmahandle/handle_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ struct HandleKey {

template <typename SerializerT>
void serialize(SerializerT& s) {
s | handle_;

s.countBytes(proxy_);
s | handle_
| proxy_;
}
};

Expand Down
1 change: 1 addition & 0 deletions src/vt/rdmahandle/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ struct Manager : runtime::component::Component<Manager> {
| collective_scope_;

s.addBytes(getHolderFootprint());
s.skip(holder_footprint_);
}

private:
Expand Down
1 change: 1 addition & 0 deletions src/vt/termination/graph/epoch_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ struct EpochGraph {
s | *successors_[i];
}
}
s.skip(successors_);
}

private:
Expand Down
2 changes: 2 additions & 0 deletions src/vt/termination/interval/integral_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ struct IntegralSetBase {
if (s.isUnpacking()) {
hint_ = set_.end();
}
s.skip(hint_);

s | elms_;
}

Expand Down
2 changes: 2 additions & 0 deletions src/vt/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ struct Trace : runtime::component::Component<Trace>, TraceLite {
| flush_event_
| between_sched_event_type_
| between_sched_event_;

s.skip(log_file_); // definition unavailable
}

private:
Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/balance/elm_stats.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void ElementStats::serialize(Serializer& s) {
s | phase_comm_;
s | cur_subphase_;
s | subphase_timings_;
s | subphase_comm_;
}

template <typename ColT>
Expand Down
1 change: 1 addition & 0 deletions src/vt/vrt/collection/messages/user.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void CollectionMessage<ColT, BaseMsgT>::serialize(SerializerT& s) {
s | bcast_proxy_;
s | bcast_epoch_;
s | is_wrap_;
s | from_node_;

#if vt_check_enabled(lblite)
s | lb_lite_instrument_;
Expand Down
16 changes: 14 additions & 2 deletions tests/unit/termination/test_term_dep_send_chain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ struct MyCol : vt::Collection<MyCol,vt::Index2D> {
if (not s.isUnpacking()) {
vtAssert(op6_msgs_.size() == 0, "Stack should be empty during serialize");
}
s.skip(op6_msgs_);
}

private:
Expand Down Expand Up @@ -439,7 +440,13 @@ struct MyObjGroup {
}

template <typename SerializerT>
void serialize(SerializerT& s) {}
void serialize(SerializerT& s) {
s | started_
| epoch_
| backend_proxy_
| frontend_proxy_
| chains_;
}

private:
// Has an update been started
Expand Down Expand Up @@ -634,7 +641,12 @@ struct MergeObjGroup
}

template <typename SerializerT>
void serialize(SerializerT& s) {}
void serialize(SerializerT& s) {
s | epoch_
| backend_proxy_
| frontend_proxy_
| chains_;
}

private:

Expand Down