Skip to content

Commit

Permalink
#2302: Fix guards
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrepebay committed Dec 12, 2024
1 parent e057fb8 commit 1175442
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/vt/runnable/runnable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,26 @@ void RunnableNew::run() {
#endif
}

#if vt_check_enabled(perf) || vt_check_enabled(papi)
void RunnableNew::startMetrics() {
#if vt_check_enabled(papi)
contexts_.lb.startPAPIMetrics();
if (contexts_.has_lb)
{
contexts_.lb.startPAPIMetrics();
}
#elif vt_check_enabled(perf)
vt::thePerfData()->startTaskMeasurement();
#else
#error "vt wasn't configured with measurement options"
#endif
}

void RunnableNew::stopMetrics() {
#if vt_check_enabled(papi)
contexts_.lb.stopPAPIMetrics();
if (contexts_.has_lb)
{
contexts_.lb.stopPAPIMetrics();
}
#elif vt_check_enabled(perf)
vt::thePerfData()->stopTaskMeasurement();
#else
#error "vt wasn't configured with measurement options"
#endif
}

Expand All @@ -227,10 +230,9 @@ std::unordered_map<std::string, uint64_t> RunnableNew::getMetrics() {
}
#elif vt_check_enabled(perf)
return vt::thePerfData()->getTaskMeasurements();
#else
#error "vt wasn't configured with measurement options"
#endif
}
#endif

void RunnableNew::start(TimeType time) {
contexts_.setcontext.start();
Expand Down
2 changes: 2 additions & 0 deletions src/vt/runnable/runnable.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ struct RunnableNew {
*/
BaseMsgType* getMsg() const { return msg_.get(); }

#if vt_check_enabled(perf) || vt_check_enabled(papi)
/**
* \brief Start metrics associated to this runnable for the running context
*/
Expand All @@ -339,6 +340,7 @@ struct RunnableNew {
* \return the dictionnary
*/
std::unordered_map<std::string, uint64_t> getMetrics();
#endif

#if vt_check_enabled(fcontext)
/**
Expand Down

0 comments on commit 1175442

Please sign in to comment.