Skip to content

Commit

Permalink
#1055: Make post-LB release of execution uncounted, since invocation …
Browse files Browse the repository at this point in the history
…is singular
  • Loading branch information
PhilMiller committed Sep 25, 2020
1 parent 1251479 commit d64ab7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 43 deletions.
24 changes: 1 addition & 23 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,35 +274,13 @@ void LBManager::finishedRunningLB(PhaseType phase) {
lb, node,
"finishedRunningLB\n"
);
releaseImpl(phase);
}

void LBManager::releaseImpl(PhaseType phase, std::size_t num_calls) {
vt_debug_print(
lb, node,
"releaseImpl: phase={}, num_invocations_={}, num_calls={}, num_release={}\n",
phase, num_invocations_, num_calls, num_release_
);

vtAssert(
num_calls != 0 or
num_invocations_ > 0, "Must be automatically invoked to releaseImpl"
);
num_release_++;
if (num_release_ == num_calls or num_release_ == num_invocations_) {
releaseNow(phase);
}
}

void LBManager::releaseNow(PhaseType phase) {
vt_debug_print(lb, node, "releaseNow\n");

auto this_node = theContext()->getNode();

if (this_node == 0) {
vt_print(
lb,
"LBManager::releaseNow: finished LB, phase={}, invocations={}\n",
"LBManager::finishedRunningLB: finished LB, phase={}, invocations={}\n",
phase, num_invocations_
);
}
Expand Down
21 changes: 1 addition & 20 deletions src/vt/vrt/collection/balance/lb_invoke/lb_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,14 @@ struct LBManager : runtime::component::Component<LBManager> {
proxy_ = proxy;
}

protected:
/**
* \internal \brief Tell the manager the LB is finished.
*
* \warning This should *not* be called by the
* user, only by load balancers. Not private/protected as friending every LBs
* adds too much overhead
* \param[in] phase the phase that is finished
*/
void finishedRunningLB(PhaseType phase);

protected:
/**
* \internal \brief Collectively start load balancing
*
Expand All @@ -142,21 +138,6 @@ struct LBManager : runtime::component::Component<LBManager> {
PhaseType phase, bool manual, std::size_t num_calls = 1
);

/**
* \internal \brief Release control back to user
*
* \param[in] phase the phase
* \param[in] num_calls number of calls required to start
*/
void releaseImpl(PhaseType phase, std::size_t num_calls = 0);

/**
* \internal \brief Release control back to user now (without counting down)
*
* \param[in] phase the phase
*/
void releaseNow(PhaseType phase);

public:
/**
* \internal \brief Print the memory usage for a phase
Expand Down

0 comments on commit d64ab7d

Please sign in to comment.