Skip to content

Commit

Permalink
#2240: Fix compile issues on some compilers and runtime issue with pa…
Browse files Browse the repository at this point in the history
…ssing proxy by reference
  • Loading branch information
JacobDomagala committed Oct 10, 2024
1 parent 641c9dd commit 1a0879e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/vt/collective/reduce/allreduce/rabenseifner.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Rabenseifner<DataT, Op, ObjT, finalHandler>::Rabenseifner(
vrt_node_ = this_node_ - nprocs_rem_;
}

vt_debug_print(terse, allreduce, "Rabenseifner constructor\n");
initialize(generateNewId(), std::forward<Args>(data)...);
}

Expand All @@ -83,6 +84,8 @@ template <
{
auto& state = states_[id];

vt_debug_print(terse, allreduce, "Rabenseifner initializing state for ID = {}\n", id);

state.scatter_messages_.resize(num_steps_, nullptr);
state.scatter_steps_recv_.resize(num_steps_, false);
state.scatter_steps_reduced_.resize(num_steps_, false);
Expand Down Expand Up @@ -173,6 +176,7 @@ template <
typename DataT, template <typename Arg> class Op, typename ObjT,
auto finalHandler>
void Rabenseifner<DataT, Op, ObjT, finalHandler>::allreduce(size_t id) {
vt_debug_print(terse, allreduce, "Rabenseifner allreduce is_part_of_adjustment_group_ = {}\n", is_part_of_adjustment_group_);
if (is_part_of_adjustment_group_) {
adjustForPowerOfTwo(id);
} else {
Expand All @@ -188,6 +192,10 @@ void Rabenseifner<DataT, Op, ObjT, finalHandler>::adjustForPowerOfTwo(size_t id)
auto& state = states_.at(id);
auto const partner = is_even_ ? this_node_ + 1 : this_node_ - 1;

vt_debug_print(
terse, allreduce, "Rabenseifner (Send Part1): To Node {} ID = {}\n", partner, id
);

if (is_even_) {
proxy_[partner]
.template send<&Rabenseifner::adjustForPowerOfTwoRightHalf>(
Expand All @@ -204,10 +212,6 @@ void Rabenseifner<DataT, Op, ObjT, finalHandler>::adjustForPowerOfTwo(size_t id)
adjustForPowerOfTwoRightHalf(state.right_adjust_message_.get());
}
}

vt_debug_print(
terse, allreduce, "Rabenseifner (Send Part1): To Node {} ID = {}\n", partner, id
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void RecursiveDoubling<DataT, Op, ObjT, finalHandler>::tryReduce(size_t id, int3

vt_debug_print(
terse, allreduce, "RecursiveDoubling Part2 (Reduce step {}): state.step_ = {} state.steps_reduced_[step] = {} state.steps_recv_[step] = {} all_msgs_received = {} ID = {} \n",
step, state.step_, state.steps_reduced_[step], state.steps_recv_[step], all_msgs_received, id);
step, state.step_, static_cast<bool>(state.steps_reduced_[step]), static_cast<bool>(state.steps_recv_[step]), all_msgs_received, id);

if (
(step < state.step_) and not state.steps_reduced_[step] and
Expand Down
2 changes: 1 addition & 1 deletion src/vt/objgroup/manager.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ ObjGroupManager::PendingSendType ObjGroupManager::allreduce(

return PendingSendType{
theTerm()->getEpoch(),
[&] { grp_proxy[this_node].template invoke<&Reducer::allreduce>(id); }
[=] { grp_proxy[this_node].template invoke<&Reducer::allreduce>(id); }
};
}

Expand Down
1 change: 0 additions & 1 deletion tests/perf/allreduce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include <vt/collective/reduce/allreduce/rabenseifner.h>
#include <vt/collective/reduce/allreduce/recursive_doubling.h>

#include <fmt-vt/core.h>
#ifdef MAGISTRATE_KOKKOS_ENABLED
#include <Kokkos_Core.hpp>
#endif
Expand Down

0 comments on commit 1a0879e

Please sign in to comment.