From 5c60934ffeb26edaa98f562229b488f63822becd Mon Sep 17 00:00:00 2001 From: Pierre Pebay Date: Mon, 5 Aug 2024 11:47:01 -0600 Subject: [PATCH] #2302: Fix preprocessor directives --- src/vt/context/context.h | 6 +++--- src/vt/context/runnable_context/lb_data.impl.h | 2 +- src/vt/runnable/runnable.cc | 2 ++ src/vt/runnable/runnable.h | 2 ++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vt/context/context.h b/src/vt/context/context.h index f01cf5dc57..f880d539c9 100644 --- a/src/vt/context/context.h +++ b/src/vt/context/context.h @@ -46,9 +46,6 @@ #include #include -#if vt_check_enabled(papi) -#include -#endif #include "vt/config.h" #include "vt/runtime/component/component_pack.h" @@ -65,6 +62,9 @@ struct RunnableNew; #if vt_check_enabled(trace_enabled) # include "vt/trace/trace_common.h" #endif +#if vt_check_enabled(papi) +# include +#endif namespace vt { namespace ctx { diff --git a/src/vt/context/runnable_context/lb_data.impl.h b/src/vt/context/runnable_context/lb_data.impl.h index 92e14a3c3c..c9f075a129 100644 --- a/src/vt/context/runnable_context/lb_data.impl.h +++ b/src/vt/context/runnable_context/lb_data.impl.h @@ -60,7 +60,7 @@ template LBData::LBData(ElmT* in_elm, MsgT* msg) : lb_data_(&in_elm->getLBData()), cur_elm_id_(in_elm->getElmID()), - should_instrument_(msg->lbLiteInstrument()), + should_instrument_(msg->lbLiteInstrument()) { #if vt_check_enabled(papi) papiData_ = std::make_unique(); diff --git a/src/vt/runnable/runnable.cc b/src/vt/runnable/runnable.cc index 72d94c7842..4921a54619 100644 --- a/src/vt/runnable/runnable.cc +++ b/src/vt/runnable/runnable.cc @@ -199,6 +199,7 @@ void RunnableNew::run() { #endif } +#if vt_check_enabled(papi) std::unordered_map RunnableNew::getPAPIMetrics() { std::unordered_map result = {}; if (contexts_.has_lb) @@ -207,6 +208,7 @@ std::unordered_map RunnableNew::getPAPIMetrics() { } return result; } +#endif void RunnableNew::start(TimeType time) { contexts_.setcontext.start(); diff --git a/src/vt/runnable/runnable.h b/src/vt/runnable/runnable.h index 69aa6e7419..50b0e5ff9b 100644 --- a/src/vt/runnable/runnable.h +++ b/src/vt/runnable/runnable.h @@ -321,6 +321,7 @@ struct RunnableNew { */ BaseMsgType* getMsg() const { return msg_.get(); } +#if vt_check_enabled(papi) /** * \brief Start PAPI metrics map for the running context */ @@ -340,6 +341,7 @@ struct RunnableNew { * \return the dictionnary */ std::unordered_map getPAPIMetrics(); +#endif #if vt_check_enabled(fcontext) /**