Skip to content

Commit

Permalink
#2281: Add unit tests for new callback (BcastCollective)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDomagala committed Sep 3, 2024
1 parent 0880641 commit 06165a0
Show file tree
Hide file tree
Showing 12 changed files with 317 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/vt/collective/reduce/allreduce/rabenseifner.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
//@HEADER
*/


#if !defined INCLUDED_VT_COLLECTIVE_REDUCE_ALLREDUCE_RABENSEIFNER_H
#define INCLUDED_VT_COLLECTIVE_REDUCE_ALLREDUCE_RABENSEIFNER_H

Expand Down
1 change: 0 additions & 1 deletion src/vt/collective/reduce/allreduce/rabenseifner_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
//@HEADER
*/


#if !defined INCLUDED_VT_COLLECTIVE_REDUCE_ALLREDUCE_RABENSEIFNER_MSG_H
#define INCLUDED_VT_COLLECTIVE_REDUCE_ALLREDUCE_RABENSEIFNER_MSG_H
#include "vt/config.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
//@HEADER
*/


#if !defined INCLUDED_VT_COLLECTIVE_REDUCE_ALLREDUCE_RECURSIVE_DOUBLING_IMPL_H
#define INCLUDED_VT_COLLECTIVE_REDUCE_ALLREDUCE_RECURSIVE_DOUBLING_IMPL_H

Expand Down
1 change: 0 additions & 1 deletion src/vt/group/group_manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
//@HEADER
*/

#include "vt/objgroup/proxy/proxy_objgroup.h"
#if !defined INCLUDED_VT_GROUP_GROUP_MANAGER_IMPL_H
#define INCLUDED_VT_GROUP_GROUP_MANAGER_IMPL_H

Expand Down
2 changes: 0 additions & 2 deletions src/vt/objgroup/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
//@HEADER
*/

#include "vt/group/group_manager.h"
#include "vt/utils/fntraits/fntraits.h"
#if !defined INCLUDED_VT_OBJGROUP_MANAGER_IMPL_H
#define INCLUDED_VT_OBJGROUP_MANAGER_IMPL_H

Expand Down
10 changes: 10 additions & 0 deletions src/vt/pipe/pipe_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ struct PipeManager
template <auto f, typename ProxyT>
auto makeBcast(ProxyT proxy);

/**
* \brief Make collective broadcast callback to collection
*
* \param[in] proxy the proxy to target
*
* \return a callback
*/
template <auto f, typename ProxyT>
auto makeBcastCollective(ProxyT proxy);

/**
* \brief Make callback to a function (including lambdas) with a context
* pointer to any object on this node.
Expand Down
5 changes: 5 additions & 0 deletions src/vt/pipe/pipe_manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ auto PipeManager::makeBcast(ProxyT proxy) {
return makeCallbackProxy<f, true>(proxy);
}

template <auto f, typename ProxyT>
auto PipeManager::makeBcastCollective(ProxyT proxy) {
return makeCallbackBcastCollectiveProxy<f>(proxy);
}

template <typename MsgT, ActiveTypedFnType<MsgT>* f>
Callback<MsgT> PipeManager::makeBcast() {
return makeCallbackSingle<f, true>();
Expand Down
2 changes: 1 addition & 1 deletion src/vt/pipe/pipe_manager_tl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct PipeManagerTL : virtual PipeManagerBase {
auto makeCallbackProxy(ProxyT proxy);

template <auto f, typename ProxyT>
auto makeCallbackBcastProxy(ProxyT proxy);
auto makeCallbackBcastCollectiveProxy(ProxyT proxy);

// Multi-staged callback
template <typename=void>
Expand Down
2 changes: 1 addition & 1 deletion src/vt/pipe/pipe_manager_tl.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ template <typename U>
using hasIdx_t = typename U::IndexType;

template <auto f, typename ProxyT>
auto PipeManagerTL::makeCallbackBcastProxy(ProxyT proxy) {
auto PipeManagerTL::makeCallbackBcastCollectiveProxy(ProxyT proxy) {
bool const persist = true;
bool const send_back = false;
bool const dispatch = true;
Expand Down
2 changes: 0 additions & 2 deletions src/vt/vrt/collection/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
//@HEADER
*/

#include "vt/configs/types/types_type.h"
#include <cstdint>
#if !defined INCLUDED_VT_VRT_COLLECTION_MANAGER_H
#define INCLUDED_VT_VRT_COLLECTION_MANAGER_H

Expand Down
5 changes: 1 addition & 4 deletions src/vt/vrt/collection/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
//@HEADER
*/

#include "vt/collective/reduce/scoping/strong_types.h"
#include "vt/messaging/message/smart_ptr.h"
#include "vt/vrt/collection/manager.fwd.h"
#if !defined INCLUDED_VT_VRT_COLLECTION_MANAGER_IMPL_H
#define INCLUDED_VT_VRT_COLLECTION_MANAGER_IMPL_H

Expand Down Expand Up @@ -936,7 +933,7 @@ messaging::PendingSend CollectionManager::reduceLocal(
auto* obj = obj_proxy[theContext()->getNode()].get();
obj->proxy_ = obj_proxy;

auto cb = vt::theCB()->makeCallbackBcastProxy<f>(proxy);
auto cb = vt::theCB()->makeCallbackBcastCollectiveProxy<f>(proxy);
obj->setFinalHandler(cb);

if(num_elms == 1){
Expand Down
Loading

0 comments on commit 06165a0

Please sign in to comment.