Skip to content

Commit

Permalink
#962 registry- remove needless message-passing to auto-registry methods
Browse files Browse the repository at this point in the history
- Not needed, if ever might have been.
  • Loading branch information
pnstickne committed Sep 1, 2020
1 parent 8d94cb6 commit ad39899
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 68 deletions.
2 changes: 1 addition & 1 deletion src/vt/collective/reduce/reduce.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ detail::ReduceStamp Reduce::reduceImmediate(
}
auto cur_id = id == detail::ReduceStamp{} ? generateNextID() : id;

auto const han = auto_registry::makeAutoHandler<MsgT,f>(msg);
auto const han = auto_registry::makeAutoHandler<MsgT,f>();
msg->combine_handler_ = han;
msg->reduce_root_ = root;
msg->reduce_id_ = detail::ReduceIDImpl{cur_id, scope_};
Expand Down
2 changes: 1 addition & 1 deletion src/vt/collective/scatter/scatter.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void Scatter::scatter(
nptr-ptr
);
vtAssert(nptr == ptr + combined_size, "nptr must match size");
auto const& handler = auto_registry::makeAutoHandler<MessageT,f>(nullptr);
auto const& handler = auto_registry::makeAutoHandler<MessageT,f>();
auto const& this_node = theContext()->getNode();
scatter_msg->user_han = handler;
if (this_node != root_node) {
Expand Down
2 changes: 1 addition & 1 deletion src/vt/pipe/pipe_manager_construct.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ConstructCallbacksImpl<cur,T,ConsT,U,N,fcur,f...>::make(ConsT const& ct) {
return std::tuple_cat(
std::make_tuple(
build<size,T>(
auto_registry::makeAutoHandler<U,fcur>(nullptr), std::get<cur>(ct)
auto_registry::makeAutoHandler<U,fcur>(), std::get<cur>(ct)
)
),
ConstructCallbacksImpl<cur+1,T,ConsT,U,N,f...>::make(ct)
Expand Down
26 changes: 10 additions & 16 deletions src/vt/pipe/pipe_manager_tl.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ PipeManagerTL::CallbackMsgType<T> PipeManagerTL::makeCallbackTyped() {

template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
void PipeManagerTL::addListener(CallbackT const& cb, NodeType const& node) {
auto const& han = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& han = auto_registry::makeAutoHandler<MsgT,f>();
addListenerAny<MsgT>(
cb.getPipe(), std::make_unique<callback::CallbackSend<MsgT>>(han,node)
);
}

template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
void PipeManagerTL::addListenerBcast(CallbackT const& cb, bool const& inc) {
auto const& han = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& han = auto_registry::makeAutoHandler<MsgT,f>();
addListenerAny<MsgT>(
cb.getPipe(), std::make_unique<callback::CallbackBcast<MsgT>>(han,inc)
);
Expand Down Expand Up @@ -148,9 +148,7 @@ PipeManagerTL::makeCallbackSingleProxySend(typename ColT::ProxyType proxy) {
auto const& pipe_id = makePipeID(persist,send_back);
newPipeState(pipe_id,persist,dispatch,-1,-1,0);
auto cb = CallbackT(callback::cbunion::RawSendColMsgTag,pipe_id);
auto const& handler = auto_registry::makeAutoHandlerCollection<ColT,MsgT,f>(
nullptr
);
auto const& handler = auto_registry::makeAutoHandlerCollection<ColT,MsgT,f>();
bool member = false;
addListenerAny<MsgT>(
cb.getPipe(),
Expand All @@ -174,7 +172,7 @@ PipeManagerTL::makeCallbackSingleProxySend(typename ColT::ProxyType proxy) {
newPipeState(pipe_id,persist,dispatch,-1,-1,0);
auto cb = CallbackT(callback::cbunion::RawSendColMsgTag,pipe_id);
auto const& handler =
auto_registry::makeAutoHandlerCollectionMem<ColT,MsgT,f>(nullptr);
auto_registry::makeAutoHandlerCollectionMem<ColT,MsgT,f>();
bool member = true;
addListenerAny<MsgT>(
cb.getPipe(),
Expand Down Expand Up @@ -240,9 +238,7 @@ PipeManagerTL::makeCallbackSingleProxyBcast(ColProxyType<ColT> proxy) {
auto const& pipe_id = makePipeID(persist,send_back);
newPipeState(pipe_id,persist,dispatch,-1,-1,0);
auto cb = CallbackT(callback::cbunion::RawBcastColMsgTag,pipe_id);
auto const& handler = auto_registry::makeAutoHandlerCollection<ColT,MsgT,f>(
nullptr
);
auto const& handler = auto_registry::makeAutoHandlerCollection<ColT,MsgT,f>();
addListenerAny<MsgT>(
cb.getPipe(),
std::make_unique<callback::CallbackProxyBcast<ColT,MsgT>>(handler,proxy)
Expand All @@ -261,9 +257,7 @@ PipeManagerTL::makeCallbackSingleProxyBcastDirect(ColProxyType<ColT> proxy) {
bool const dispatch = true;
auto const& pipe_id = makePipeID(persist,send_back);
newPipeState(pipe_id,persist,dispatch,-1,-1,0);
auto const& handler = auto_registry::makeAutoHandlerCollection<ColT,MsgT,f>(
nullptr
);
auto const& handler = auto_registry::makeAutoHandlerCollection<ColT,MsgT,f>();
auto const& vrt_handler = vrt::collection::makeVrtDispatch<MsgT,ColT>();
bool const member = false;
auto cb = CallbackT(
Expand Down Expand Up @@ -291,7 +285,7 @@ PipeManagerTL::makeCallbackSingleProxyBcastDirect(ColProxyType<ColT> proxy) {
auto const& pipe_id = makePipeID(persist,send_back);
newPipeState(pipe_id,persist,dispatch,-1,-1,0);
auto const& handler =
auto_registry::makeAutoHandlerCollectionMem<ColT,MsgT,f>(nullptr);
auto_registry::makeAutoHandlerCollectionMem<ColT,MsgT,f>();
auto const& vrt_handler = vrt::collection::makeVrtDispatch<MsgT,ColT>();
bool const member = true;
auto cb = CallbackT(
Expand All @@ -311,7 +305,7 @@ template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
CallbackT
PipeManagerTL::makeCallbackSingleSend(NodeType const& send_to_node) {
auto const& new_pipe_id = makePipeID(true,false);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>();
auto cb = CallbackT(
callback::cbunion::RawSendMsgTag,new_pipe_id,handler,send_to_node
);
Expand All @@ -322,7 +316,7 @@ template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
CallbackT
PipeManagerTL::makeCallbackSingleSendT(NodeType const& send_to_node) {
auto const& new_pipe_id = makePipeID(true,false);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>();
auto cb = CallbackT(
callback::cbunion::RawSendMsgTag,new_pipe_id,handler,send_to_node
);
Expand All @@ -333,7 +327,7 @@ template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
CallbackT
PipeManagerTL::makeCallbackSingleBcast(bool const& inc) {
auto const& new_pipe_id = makePipeID(true,false);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>();
auto cb = CallbackT(
callback::cbunion::RawBcastMsgTag,new_pipe_id,handler,inc
);
Expand Down
12 changes: 6 additions & 6 deletions src/vt/pipe/pipe_manager_typed.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ PipeManagerTyped::makeCallbackSingleSendTyped(
bool const is_persist, NodeType const& send_to_node
) {
auto const& new_pipe_id = makePipeID(is_persist,false);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>();
auto container = CallbackSendType<MsgT>(
new_pipe_id,handler,send_to_node
);
Expand Down Expand Up @@ -138,7 +138,7 @@ template <typename MsgT, ActiveTypedFnType<MsgT>* f>
PipeManagerTyped::CallbackBcastType<MsgT>
PipeManagerTyped::makeCallbackSingleBcastTyped(bool const inc) {
auto const& new_pipe_id = makePipeID(true,false);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& handler = auto_registry::makeAutoHandler<MsgT,f>();
auto container = CallbackBcastType<MsgT>(
new_pipe_id,handler,inc
);
Expand Down Expand Up @@ -227,29 +227,29 @@ PipeManagerTyped::makeCallbackMultiSendTyped(

template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
auto PipeManagerTyped::pushTargetBcast(CallbackT in, bool const& inc) {
auto const& han = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& han = auto_registry::makeAutoHandler<MsgT,f>();
return std::tuple_cat(
std::make_tuple(callback::CallbackBcast<MsgT>(han,inc)), in
);
}

template <typename MsgT, ActiveTypedFnType<MsgT>* f>
auto PipeManagerTyped::pushTargetBcast(bool const& inc) {
auto const& han = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& han = auto_registry::makeAutoHandler<MsgT,f>();
return std::make_tuple(callback::CallbackBcast<MsgT>(han,inc));
}

template <typename MsgT, ActiveTypedFnType<MsgT>* f, typename CallbackT>
auto PipeManagerTyped::pushTarget(CallbackT in, NodeType const& send_to_node) {
auto const& han = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& han = auto_registry::makeAutoHandler<MsgT,f>();
return std::tuple_cat(
std::make_tuple(callback::CallbackSend<MsgT>(han,send_to_node)), in
);
}

template <typename MsgT, ActiveTypedFnType<MsgT>* f>
auto PipeManagerTyped::pushTarget(NodeType const& send_to_node) {
auto const& han = auto_registry::makeAutoHandler<MsgT,f>(nullptr);
auto const& han = auto_registry::makeAutoHandler<MsgT,f>();
return std::make_tuple(callback::CallbackSend<MsgT>(han,send_to_node));
}

Expand Down
4 changes: 2 additions & 2 deletions src/vt/rdma/state/rdma_state.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ RDMA_HandlerType State::setRDMAGetFn(

RDMA_HandlerType const handler = makeRdmaHandler(RDMA_TypeType::Get);

auto const reg_han = auto_registry::makeAutoHandlerRDMAGet<MsgT,f>(nullptr);
auto const reg_han = auto_registry::makeAutoHandlerRDMAGet<MsgT,f>();

if (any_tag) {
vtAssert(
Expand Down Expand Up @@ -102,7 +102,7 @@ RDMA_HandlerType State::setRDMAPutFn(
tag, handle, print_bool(any_tag)
);

auto const reg_han = auto_registry::makeAutoHandlerRDMAPut<MsgT,f>(nullptr);
auto const reg_han = auto_registry::makeAutoHandlerRDMAPut<MsgT,f>();

if (any_tag) {
vtAssert(
Expand Down
13 changes: 1 addition & 12 deletions src/vt/registry/auto/auto_registry_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ inline HandlerType makeAutoHandlerObjGroup(HandlerControlType ctrl) {
return han;
}

template <typename MessageT, ActiveTypedFnType<MessageT>* f>
inline HandlerType makeAutoHandler(MessageT* const __attribute__((unused)) msg) {
using AdapterT = FunctorAdapter<ActiveTypedFnType<MessageT>, f>;
using ContainerType = AutoActiveContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveType>;
using FuncType = ActiveFnPtrType;
using RunType = RunnableGen<AdapterT, ContainerType, RegInfoType, FuncType>;

return HandlerManagerType::makeHandler(true, false, RunType::idx);
}

template <typename MessageT, ActiveTypedFnType<MessageT>* f>
inline HandlerType makeAutoHandler() {
using AdapterT = FunctorAdapter<ActiveTypedFnType<MessageT>, f>;
Expand Down Expand Up @@ -150,7 +139,7 @@ void setHandlerTraceNameObjGroup(
template <typename MsgT, ActiveTypedFnType<MsgT>* f>
void setHandlerTraceName(std::string const& name, std::string const& parent) {
#if vt_check_enabled(trace_enabled)
auto const handler = makeAutoHandler<MsgT,f>(nullptr);
auto const handler = makeAutoHandler<MsgT,f>();
auto const trace_id = handlerTraceID(handler, RegistryTypeEnum::RegGeneral);
trace::TraceRegistry::setTraceName(trace_id, name, parent);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/vt/registry/auto/auto_registry_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
namespace vt { namespace auto_registry {

template <typename MsgT, ActiveTypedFnType<MsgT>* f>
HandlerType makeAutoHandler(MsgT* const msg);
HandlerType makeAutoHandler();

template <typename T, T value>
HandlerType makeAutoHandlerParam();
Expand Down
4 changes: 2 additions & 2 deletions src/vt/registry/auto/collection/auto_registry_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ using namespace ::vt::vrt::collection;
AutoActiveCollectionType getAutoHandlerCollection(HandlerType const& handler);

template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
HandlerType makeAutoHandlerCollection(MsgT* const msg);
HandlerType makeAutoHandlerCollection();

AutoActiveCollectionMemType getAutoHandlerCollectionMem(
HandlerType const& handler
Expand All @@ -68,7 +68,7 @@ AutoActiveCollectionMemType getAutoHandlerCollectionMem(
template <
typename ColT, typename MsgT, ActiveColMemberTypedFnType<MsgT, ColT> f
>
HandlerType makeAutoHandlerCollectionMem(MsgT* const msg);
HandlerType makeAutoHandlerCollectionMem();

template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
void setHandlerTraceNameColl(std::string const& name, std::string const& parent = "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inline AutoActiveCollectionType getAutoHandlerCollection(
}

template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
inline HandlerType makeAutoHandlerCollection(MsgT* const msg) {
inline HandlerType makeAutoHandlerCollection() {
using FunctorT = FunctorAdapter<ActiveColTypedFnType<MsgT, ColT>, f>;
using ContainerType = AutoActiveCollectionContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveCollectionType>;
Expand All @@ -76,7 +76,7 @@ inline AutoActiveCollectionMemType getAutoHandlerCollectionMem(
template <
typename ColT, typename MsgT, ActiveColMemberTypedFnType<MsgT, ColT> f
>
inline HandlerType makeAutoHandlerCollectionMem(MsgT* const msg) {
inline HandlerType makeAutoHandlerCollectionMem() {
using FunctorT = FunctorAdapterMember<ActiveColMemberTypedFnType<MsgT, ColT>, f>;
using ContainerType = AutoActiveCollectionMemContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveCollectionMemType>;
Expand All @@ -87,7 +87,7 @@ inline HandlerType makeAutoHandlerCollectionMem(MsgT* const msg) {
template <typename ColT, typename MsgT, ActiveColTypedFnType<MsgT, ColT>* f>
void setHandlerTraceNameColl(std::string const& name, std::string const& parent) {
#if vt_check_enabled(trace_enabled)
auto const handler = makeAutoHandlerCollection<ColT,MsgT,f>(nullptr);
auto const handler = makeAutoHandlerCollection<ColT,MsgT,f>();
auto const trace_id = handlerTraceID(handler, RegistryTypeEnum::RegVrtCollection);
trace::TraceRegistry::setTraceName(trace_id, name, parent);
#endif
Expand All @@ -96,7 +96,7 @@ void setHandlerTraceNameColl(std::string const& name, std::string const& parent)
template <typename ColT, typename MsgT, ActiveColMemberTypedFnType<MsgT, ColT> f>
void setHandlerTraceNameCollMem(std::string const& name, std::string const& parent) {
#if vt_check_enabled(trace_enabled)
auto const handler = makeAutoHandlerCollectionMem<ColT,MsgT,f>(nullptr);
auto const handler = makeAutoHandlerCollectionMem<ColT,MsgT,f>();
auto const trace_id = handlerTraceID(handler, RegistryTypeEnum::RegVrtCollectionMember);
trace::TraceRegistry::setTraceName(trace_id, name, parent);
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/vt/registry/auto/rdma/auto_registry_rdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ AutoActiveRDMAGetType getAutoHandlerRDMAGet(HandlerType const& handler);
AutoActiveRDMAPutType getAutoHandlerRDMAPut(HandlerType const& handler);

template <typename MsgT, ActiveTypedRDMAPutFnType<MsgT>* f>
HandlerType makeAutoHandlerRDMAPut(MsgT* const msg);
HandlerType makeAutoHandlerRDMAPut();

template <typename MsgT, ActiveTypedRDMAGetFnType<MsgT>* f>
HandlerType makeAutoHandlerRDMAGet(MsgT* const msg);
HandlerType makeAutoHandlerRDMAGet();

}} /* end namespace vt::auto_registry */

Expand Down
4 changes: 2 additions & 2 deletions src/vt/registry/auto/rdma/auto_registry_rdma.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inline AutoActiveRDMAPutType getAutoHandlerRDMAPut(HandlerType const& handler) {
}

template <typename MsgT, ActiveTypedRDMAPutFnType<MsgT>* f>
inline HandlerType makeAutoHandlerRDMAPut(MsgT* const msg) {
inline HandlerType makeAutoHandlerRDMAPut() {
using FunctorT = FunctorAdapter<ActiveTypedRDMAPutFnType<MsgT>, f>;
using ContainerType = AutoActiveRDMAPutContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveRDMAPutType>;
Expand All @@ -72,7 +72,7 @@ inline AutoActiveRDMAGetType getAutoHandlerRDMAGet(HandlerType const& handler) {
}

template <typename MsgT, ActiveTypedRDMAGetFnType<MsgT>* f>
inline HandlerType makeAutoHandlerRDMAGet(MsgT* const msg) {
inline HandlerType makeAutoHandlerRDMAGet() {
using FunctorT = FunctorAdapter<ActiveTypedRDMAGetFnType<MsgT>, f>;
using ContainerType = AutoActiveRDMAGetContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveRDMAGetType>;
Expand Down
2 changes: 1 addition & 1 deletion src/vt/registry/auto/vc/auto_registry_vc.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ using namespace vrt;
AutoActiveVCType getAutoHandlerVC(HandlerType const& handler);

template <typename VrtT, typename MsgT, ActiveVrtTypedFnType<MsgT, VrtT>* f>
HandlerType makeAutoHandlerVC(MsgT* const msg);
HandlerType makeAutoHandlerVC();

}} // end namespace vt::auto_registry

Expand Down
2 changes: 1 addition & 1 deletion src/vt/registry/auto/vc/auto_registry_vc_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace vt { namespace auto_registry {
using namespace vrt;

template <typename VrtT, typename MsgT, ActiveVrtTypedFnType<MsgT, VrtT>* f>
inline HandlerType makeAutoHandlerVC(MsgT* const __attribute__((unused)) msg) {
inline HandlerType makeAutoHandlerVC() {
using FunctorT = FunctorAdapter<ActiveVrtTypedFnType<MsgT, VrtT>, f>;
using ContainerType = AutoActiveVCContainerType;
using RegInfoType = AutoRegInfoType<AutoActiveVCType>;
Expand Down
4 changes: 2 additions & 2 deletions src/vt/topos/location/location.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void EntityLocationCoord<EntityID>::routeMsgHandler(
) {
using auto_registry::HandlerManagerType;

auto handler = auto_registry::makeAutoHandler<MessageT,f>(nullptr);
auto handler = auto_registry::makeAutoHandler<MessageT,f>();

# if vt_check_enabled(trace_enabled)
HandlerManagerType::setHandlerTrace(
Expand All @@ -620,7 +620,7 @@ void EntityLocationCoord<EntityID>::routeMsgSerializeHandler(
) {
using auto_registry::HandlerManagerType;

auto handler = auto_registry::makeAutoHandler<MessageT,f>(nullptr);
auto handler = auto_registry::makeAutoHandler<MessageT,f>();

# if vt_check_enabled(trace_enabled)
HandlerManagerType::setHandlerTrace(
Expand Down
Loading

0 comments on commit ad39899

Please sign in to comment.