Skip to content

Commit

Permalink
#2302: Fix preprocessor directives
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrepebay committed Aug 5, 2024
1 parent 30b1083 commit 5c60934
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/vt/context/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@

#include <memory>
#include <mpi.h>
#if vt_check_enabled(papi)
#include <papi.h>
#endif

#include "vt/config.h"
#include "vt/runtime/component/component_pack.h"
Expand All @@ -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 <papi.h>
#endif

namespace vt { namespace ctx {

Expand Down
2 changes: 1 addition & 1 deletion src/vt/context/runnable_context/lb_data.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ template <typename ElmT, typename MsgT>
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<PAPIData>();
Expand Down
2 changes: 2 additions & 0 deletions src/vt/runnable/runnable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ void RunnableNew::run() {
#endif
}

#if vt_check_enabled(papi)
std::unordered_map<std::string, uint64_t> RunnableNew::getPAPIMetrics() {
std::unordered_map<std::string, uint64_t> result = {};
if (contexts_.has_lb)
Expand All @@ -207,6 +208,7 @@ std::unordered_map<std::string, uint64_t> RunnableNew::getPAPIMetrics() {
}
return result;
}
#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 @@ -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
*/
Expand All @@ -340,6 +341,7 @@ struct RunnableNew {
* \return the dictionnary
*/
std::unordered_map<std::string, uint64_t> getPAPIMetrics();
#endif

#if vt_check_enabled(fcontext)
/**
Expand Down

0 comments on commit 5c60934

Please sign in to comment.