Skip to content

Commit

Permalink
Fix some issues surrounding WITH_PAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
bastih committed Nov 6, 2013
1 parent be5a3a0 commit 90ccedf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/bin/perf_regression/InsertScan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "io/TransactionManager.h"
#include <io/CSVLoader.h>
#include "io/shortcuts.h"

//JoinScan Benchmark similar to TPC-C Implementation of Stock-Level Transaction
//See TPC-C Reference Chapter A.5

Expand All @@ -32,11 +31,11 @@ class InsertScanBase : public ::testing::Benchmark {
EmptyInput input;
CSVHeader header("test/test10k_12.tbl");
t = Loader::load(Loader::params().setInput(input).setHeader(header));

is.setEvent("NO_PAPI");
is.setTXContext(ctx);
is.addInput(t);
is.setInputData(data);

c.setEvent("NO_PAPI");
c.setTXContext(ctx);
c.addInput(t);
}
Expand All @@ -56,4 +55,4 @@ BENCHMARK_F(InsertScanBase, insert_single_tx_commit)
{
is.execute();
c.execute();
}
}
3 changes: 2 additions & 1 deletion src/lib/helper/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ hyr-helper := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
hyr-helper.libname := hyr-helper

hyr-helper.libs := hwloc rt
ifeq ($(WITH_PAPI),1)

ifneq ($(WITH_PAPI),0)
hyr-helper.libs += papi
hyr-helper.CPPFLAGS := -DUSE_PAPI_TRACE
endif
Expand Down
6 changes: 4 additions & 2 deletions src/lib/helper/PapiTracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class TracingError : public std::runtime_error {
};

#ifdef USE_PAPI_TRACE
#include <mutex>

#include "helper/locking.h"

#include "papi.h"
Expand Down Expand Up @@ -62,7 +64,7 @@ class PapiTracer {

static void initialize() {
static bool initialized = false;
static hyrise::locking::SpinLock init_mtx;
static hyrise::locking::Spinlock init_mtx;

std::lock_guard<decltype(init_mtx)> guard(init_mtx);
if (!initialized) {
Expand All @@ -73,7 +75,7 @@ class PapiTracer {
}

public:
inline PapiTracer() : _eventSet(PAPI_nullptr), _disabled(false), _running(false) {
inline PapiTracer() : _eventSet(PAPI_NULL), _disabled(false), _running(false) {
PapiTracer::initialize();
}

Expand Down
1 change: 0 additions & 1 deletion third_party/gtest/.#gtest-bench.h

This file was deleted.

3 changes: 3 additions & 0 deletions third_party/gtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ gtest := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

-include ../../rules.mk

include $(PROJECT_ROOT)/src/lib/helper/Makefile

gtest.libname := hyr-gtest
gtest.includes := $(realpath $(gtest)/..)
gtest.deps := hyr-helper
gtest.libs := pthread log4cxx
$(eval $(call library,gtest))
2 changes: 1 addition & 1 deletion third_party/gtest/gtest-bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void testing::Benchmark::logValue(const std::string& key,

void testing::Benchmark::TestBody()
{
std::map<std::string, values_t> counters { {"PAPI_TOT_INS", {} }, /*{PapiEvent(), {}},*/ {"PAPI_L1_DCM", {}} };
std::map<std::string, values_t> counters { {"PAPI_TOT_CYC", {} }, {PapiEvent(), {}} };
for(int i=0; i < NumIterations() + WarmUp(); ++i) {
BenchmarkSetUp();

Expand Down

0 comments on commit 90ccedf

Please sign in to comment.