Skip to content

Commit

Permalink
#2094: Rename new broadcast functions to multicast
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Nov 7, 2023
1 parent d7c70af commit 8c4439a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/hello_world/objgroup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main(int argc, char** argv) {
vt::theGroup()->newGroupCollective(
this_node % 2, [proxy, this_node](::vt::GroupType type) {
if (this_node == 0) {
proxy.broadcastToGroup<&MyObjGroup::handler>(type, 122, 244);
proxy.multicast<&MyObjGroup::handler>(type, 122, 244);
}
});

Expand All @@ -91,7 +91,7 @@ int main(int argc, char** argv) {
}
}

proxy.broadcastToNodes<&MyObjGroup::handler>(
proxy.multicast<&MyObjGroup::handler>(
std::make_unique<List>(range), 20, 40
);
}
Expand Down
12 changes: 6 additions & 6 deletions src/vt/objgroup/proxy/proxy_objgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,24 +161,24 @@ struct Proxy {
PendingSendType broadcast(Args&&... args) const;

/**
* \brief Broadcast a message to nodes that are part of given group to be delivered to the local object
* \brief Multicast a message to nodes that are part of given group to be delivered to the local object
* instance
*
* \param[in] type group to broadcast
* \param[in] type group to multicast
* \param[in] args args to pass to the message constructor
*/
template <auto fn, typename... Args>
PendingSendType broadcastToGroup(GroupType type, Args&&... args) const;
PendingSendType multicast(GroupType type, Args&&... args) const;

/**
* \brief Broadcast a message to nodes specified by the region to be delivered to the local object
* \brief Multicast a message to nodes specified by the region to be delivered to the local object
* instance
*
* \param[in] nodes region of nodes to broadcast to
* \param[in] nodes region of nodes to multicast to
* \param[in] args args to pass to the message constructor
*/
template <auto fn, typename... Args>
PendingSendType broadcastToNodes(group::region::Region::RegionUPtrType&& nodes, Args&&... args) const;
PendingSendType multicast(group::region::Region::RegionUPtrType&& nodes, Args&&... args) const;

/**
* \brief All-reduce back to this objgroup. Performs a reduction using
Expand Down
6 changes: 3 additions & 3 deletions src/vt/objgroup/proxy/proxy_objgroup.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Proxy<ObjT>::broadcast(Params&&... params) const {
template <typename ObjT>
template <auto f, typename... Params>
typename Proxy<ObjT>::PendingSendType
Proxy<ObjT>::broadcastToGroup(GroupType type, Params&&... params) const{
Proxy<ObjT>::multicast(GroupType type, Params&&... params) const{
using MsgT = typename ObjFuncTraits<decltype(f)>::MsgT;
if constexpr (std::is_same_v<MsgT, NoMsg>) {
using Tuple = typename ObjFuncTraits<decltype(f)>::TupleType;
Expand All @@ -136,7 +136,7 @@ Proxy<ObjT>::broadcastToGroup(GroupType type, Params&&... params) const{

template <typename ObjT>
template <auto f, typename... Params>
typename Proxy<ObjT>::PendingSendType Proxy<ObjT>::broadcastToNodes(
typename Proxy<ObjT>::PendingSendType Proxy<ObjT>::multicast(
group::region::Region::RegionUPtrType&& nodes, Params&&... params) const {
// This will work for list-type ranges only
nodes->sort();
Expand All @@ -148,7 +148,7 @@ typename Proxy<ObjT>::PendingSendType Proxy<ObjT>::broadcastToNodes(
theGroup()->AddNewTempGroup(range, groupID.value());
}

return broadcastToGroup<f>(groupID.value(), std::forward<Params>(params)...);
return multicast<f>(groupID.value(), std::forward<Params>(params)...);
}

template <typename ObjT>
Expand Down

0 comments on commit 8c4439a

Please sign in to comment.