Skip to content

Commit

Permalink
#1983: dispatch: fix bugs in message deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Oct 24, 2022
1 parent 03127a1 commit 6e0814e
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 350 deletions.
79 changes: 0 additions & 79 deletions src/vt/objgroup/dispatch/dispatch.h

This file was deleted.

76 changes: 0 additions & 76 deletions src/vt/objgroup/dispatch/dispatch.impl.h

This file was deleted.

88 changes: 0 additions & 88 deletions src/vt/objgroup/dispatch/dispatch_base.h

This file was deleted.

44 changes: 6 additions & 38 deletions src/vt/objgroup/manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,6 @@ ObjGroupProxyType ObjGroupManager::getProxy(ObjGroupProxyType proxy) {
return proxy;
}

void ObjGroupManager::dispatch(
MsgSharedPtr<ShortMessage> msg, HandlerType han, NodeType from_node,
ActionType cont
) {
// Extract the control-bit sequence from the handler
auto const ctrl = HandlerManager::getHandlerControl(han);
vt_debug_print(
verbose, objgroup,
"dispatch: ctrl={:x}, han={:x}\n", ctrl, han
);
auto const node = 0;
auto const proxy = proxy::ObjGroupProxy::create(ctrl, node, true);
auto dispatch_iter = dispatch_.find(proxy);
vt_debug_print(
normal, objgroup,
"dispatch: try ctrl={:x}, han={:x}, has dispatch={}\n",
ctrl, han, dispatch_iter != dispatch_.end()
);
if (dispatch_iter == dispatch_.end()) {
auto const epoch = envelopeGetEpoch(msg->env);
if (epoch != no_epoch and epoch != term::any_epoch_sentinel) {
theTerm()->produce(epoch);
}
pending_[proxy].emplace_back(msg, from_node, cont, han);
} else {
dispatch_iter->second->run(han, msg.get(), from_node, cont);
}
}

ObjGroupProxyType ObjGroupManager::makeCollectiveImpl(
std::string const& label, HolderBasePtrType base, void* obj_ptr
) {
Expand Down Expand Up @@ -166,15 +137,12 @@ elm::ElementIDStruct ObjGroupManager::getNextElm(ObjGroupProxyType proxy) {
}
}

void dispatchObjGroup(
MsgSharedPtr<ShortMessage> msg, HandlerType han, NodeType from_node,
ActionType cont
) {
vt_debug_print(
verbose, objgroup,
"dispatchObjGroup: han={:x}\n", han
);
return theObjGroup()->dispatch(msg, han, from_node, cont);
std::unordered_map<ObjGroupProxyType, std::unique_ptr<holder::HolderBase>>& getObjs() {
return theObjGroup()->objs_;
}

std::unordered_map<ObjGroupProxyType, std::vector<ActionType>>& getPending() {
return theObjGroup()->pending_;
}

}} /* end namespace vt::objgroup */
7 changes: 5 additions & 2 deletions src/vt/objgroup/manager.fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ namespace detail {
holder::HolderBase* getHolderBase(HandlerType handler);
} /* end namespace detail */

template <typename MsgT>
void dispatchObjGroup(
MsgSharedPtr<ShortMessage> msg, HandlerType han, NodeType from_node,
ActionType cont
MsgSharedPtr<MsgT> msg, HandlerType han, NodeType from_node, ActionType cont
);

std::unordered_map<ObjGroupProxyType, std::unique_ptr<holder::HolderBase>>& getObjs();
std::unordered_map<ObjGroupProxyType, std::vector<ActionType>>& getPending();

template <typename MsgT>
messaging::PendingSend send(MsgSharedPtr<MsgT> msg, HandlerType han, NodeType node);
template <typename MsgT>
Expand Down
Loading

0 comments on commit 6e0814e

Please sign in to comment.