Пример #1
0
const _PlanOperation *_PlanOperation::execute() {
  epoch_t startTime = get_epoch_nanoseconds();

  refreshInput();

  setupPlanOperation();

  PapiTracer pt;
  pt.addEvent("PAPI_TOT_CYC");
  pt.addEvent(getEvent());

  pt.start();
  executePlanOperation();
  pt.stop();

  teardownPlanOperation();

  epoch_t endTime = get_epoch_nanoseconds();
  std::string threadId = boost::lexical_cast<std::string>(std::this_thread::get_id());

  if (_performance_attr != nullptr)
    *_performance_attr = (performance_attributes_t) {
      pt.value("PAPI_TOT_CYC"), pt.value(getEvent()), getEvent() , planOperationName(), _operatorId, startTime, endTime, threadId
    };

  setState(OpSuccess);
  return this;
}
Пример #2
0
TEST_F(LayouterOpsTest, simple_parse_json) {
  std::string data = loadFromFile("test/json/simple_layouter.json");
  Json::Value request_data;
  Json::Reader reader;

  // Parse JSON
  reader.parse(data, request_data);

  // parse the json
  auto s = std::dynamic_pointer_cast<LayoutSingleTable>(LayoutSingleTable::parse(request_data["operators"]["0"]));
  s->executePlanOperation();
  const auto& res = s->getResultTable();
  std::string header = loadFromFile("test/header/layouter_simple.tbl");

  ASSERT_EQ(res->getValue<std::string>(0, 0), header);
}
Пример #3
0
const PlanOperation* PlanOperation::execute() {
  const bool recordPerformance = _performance_attr != nullptr;

  // Check if we really need this
  epoch_t startTime = 0;
  if (recordPerformance)
    startTime = get_epoch_nanoseconds();

  PapiTracer pt;

  // Start the execution
  refreshInput();
  setupPlanOperation();

  if (recordPerformance) {
    pt.addEvent("PAPI_TOT_CYC");
    pt.addEvent(getEvent());
    pt.start();
  }

  executePlanOperation();

  if (recordPerformance)
    pt.stop();

  teardownPlanOperation();

  if (recordPerformance) {
    epoch_t endTime = get_epoch_nanoseconds();
    std::string threadId = boost::lexical_cast<std::string>(std::this_thread::get_id());

    size_t cardinality;
    if (getResultTable() != empty_result)
      cardinality = getResultTable()->size();
    else
      // the cardinality is max(size_t) by convention if there is no return table
      cardinality = std::numeric_limits<size_t>::max();

    *_performance_attr = (performance_attributes_t) {pt.value("PAPI_TOT_CYC"), pt.value(getEvent()), getEvent(),
                                                     planOperationName(),      _operatorId,          startTime,
                                                     endTime,                  threadId,             cardinality};
  }

  setState(OpSuccess);
  return this;
}