Skip to content

Commit 0814d87

Browse files
committed
#5: LB: switch to handle_.reduce, which is the proper call
1 parent 4bc4bdf commit 0814d87

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/vt-lb/algo/temperedlb/temperedlb.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ struct TemperedLB final : baselb::BaseLB {
340340
}
341341

342342
int const root = 0;
343-
comm_.reduce(root, MPI_INT, MPI_MAX, &local_clusters, &global_max_clusters_, 1);
343+
handle_.reduce(root, MPI_INT, MPI_MAX, &local_clusters, &global_max_clusters_, 1);
344344

345345
if (comm_.getRank() == root) {
346346
printf("%d: global max clusters across ranks: %d\n", root, global_max_clusters_);
@@ -355,9 +355,9 @@ struct TemperedLB final : baselb::BaseLB {
355355
double global_min = 0.0;
356356
double global_max = 0.0;
357357
double global_sum = 0.0;
358-
comm_.reduce(0, MPI_DOUBLE, MPI_MIN, &local_value, &global_min, 1);
359-
comm_.reduce(0, MPI_DOUBLE, MPI_MAX, &local_value, &global_max, 1);
360-
comm_.reduce(0, MPI_DOUBLE, MPI_SUM, &local_value, &global_sum, 1);
358+
handle_.reduce(0, MPI_DOUBLE, MPI_MIN, &local_value, &global_min, 1);
359+
handle_.reduce(0, MPI_DOUBLE, MPI_MAX, &local_value, &global_max, 1);
360+
handle_.reduce(0, MPI_DOUBLE, MPI_SUM, &local_value, &global_sum, 1);
361361
double global_avg = global_sum / static_cast<double>(comm_.numRanks());
362362
double I = (global_max / global_avg) - 1.0;
363363
if (comm_.getRank() == 0) {

src/vt-lb/comm/vt/proxy_wrapper.impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ template <typename ProxyT>
6262
template <typename T>
6363
void ProxyWrapper<ProxyT>::reduceAnonCb(vt::collective::ReduceTMsg<T>* msg, ReduceCtx* ctx) {
6464
auto const& val = msg->getVal();
65-
printf("%d: callback invoked\n", vt::theContext()->getNode());
65+
//printf("%d: callback invoked\n", vt::theContext()->getNode());
6666
if constexpr (
6767
std::is_same_v<std::decay_t<T>, int> || std::is_same_v<std::decay_t<T>, double> ||
6868
std::is_same_v<std::decay_t<T>, float> || std::is_same_v<std::decay_t<T>, long> ||
@@ -117,7 +117,7 @@ void ProxyWrapper<ProxyT>::reduce_impl(int root, MPI_Op op, SendBufT sendbuf, Re
117117
ctx->out_ptr = static_cast<void*>(recvbuf);
118118
ctx->count = static_cast<std::size_t>(std::max(1, count));
119119
ctx->done.store(false);
120-
printf("%d: initiating reduce\n", vt::theContext()->getNode());
120+
//printf("%d: initiating reduce\n", vt::theContext()->getNode());
121121

122122
if (count == 1) {
123123
T value = *static_cast<T const*>(sendbuf);

0 commit comments

Comments
 (0)