Browse Source

add benchmarking loop to qdp project

master
Constantin Fürst 11 months ago
parent
commit
26d584eaa3
  1. 49
      qdp_project/src/benchmark/MAX_benchmark.cpp

49
qdp_project/src/benchmark/MAX_benchmark.cpp

@ -160,53 +160,31 @@ int main(int argc, char** argv) {
}
check_file.close();
std::string iteration("init");
Query_Wrapper<base_t, simple_query, cache_a, wait_b>* qw = nullptr;
while(iteration != "false") {
for(uint32_t i = 0; i < 15; i++) {
std::promise<void> p;
std::shared_future<void> ready_future(p.get_future());
if(iteration != "run") {
if(qw != nullptr) {
delete qw;
}
uint8_t tc_filter = new_mode_manager::thread_count(simple_query ? SIMPLE_Q : COMPLEX_Q, mode.current, SCAN_A);
uint8_t tc_copy = new_mode_manager::thread_count(simple_query ? SIMPLE_Q : COMPLEX_Q, mode.current, SCAN_B);
uint8_t tc_agg = new_mode_manager::thread_count(simple_query ? SIMPLE_Q : COMPLEX_Q, mode.current, AGGR_J);
switch(mode.current) {
case NewPMode::Prefetch:
qw = new Query_Wrapper<base_t, simple_query, cache_a, wait_b>(
Query_Wrapper<base_t, simple_query, cache_a, wait_b> qw (
&ready_future, workload_b, chunk_size.current,
data_a, data_b, results, tc_filter, tc_copy, tc_agg,
mode.current, 50, 42
);
break;
default:
std::cerr << "[x] Unsupported Execution Mode by this build." << std::endl;
exit(-1);
}
}
qw.ready_future = &ready_future;
qw.clear_buffers();
qw->ready_future = &ready_future;
qw->clear_buffers();
auto filter_lambda = [&qw](uint32_t gid, uint32_t gcnt, uint32_t tid) { qw->scan_a(gid, gcnt, tid); };
auto copy_lambda = [&qw](uint32_t gid, uint32_t gcnt, uint32_t tid) { qw->scan_b(gid, gcnt, tid); };
auto aggregation_lambda = [&qw](uint32_t gid, uint32_t gcnt, uint32_t tid) { qw->aggr_j(gid, gcnt, tid); };
auto filter_lambda = [&qw](uint32_t gid, uint32_t gcnt, uint32_t tid) { qw.scan_a(gid, gcnt, tid); };
auto copy_lambda = [&qw](uint32_t gid, uint32_t gcnt, uint32_t tid) { qw.scan_b(gid, gcnt, tid); };
auto aggregation_lambda = [&qw](uint32_t gid, uint32_t gcnt, uint32_t tid) { qw.aggr_j(gid, gcnt, tid); };
std::vector<std::thread> filter_pool;
std::vector<std::thread> copy_pool;
std::vector<std::thread> agg_pool;
uint8_t tc_filter = new_mode_manager::thread_count(simple_query ? SIMPLE_Q : COMPLEX_Q, mode.current, SCAN_A);
uint8_t tc_copy = new_mode_manager::thread_count(simple_query ? SIMPLE_Q : COMPLEX_Q, mode.current, SCAN_B);
uint8_t tc_agg = new_mode_manager::thread_count(simple_query ? SIMPLE_Q : COMPLEX_Q, mode.current, AGGR_J);
int thread_id = 0;
// std::vector<std::pair<int, int>> pinning_ranges {std::make_pair(28, 42), std::make_pair(84, 98)}; // node 2 heacboehm II
//std::vector<std::pair<int, int>> pinning_ranges {std::make_pair(32, 48), std::make_pair(96, 112)}; // node 2 heacboehm
@ -243,22 +221,17 @@ int main(int argc, char** argv) {
uint64_t nanos = std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count();
double seconds = (double)(nanos) / nanos_per_second;
if (i >= 5) {
print_to_file(out_file, run, chunk_size, new_mode_manager::string(mode.current), THREAD_GROUP_MULTIPLIER, seconds,
#ifdef THREAD_TIMINGS
qw->trt->summarize_time(0), qw->trt->summarize_time(1), qw->trt->summarize_time(2),
qw.trt->summarize_time(0), qw.trt->summarize_time(1), qw.trt->summarize_time(2),
#endif
#ifdef BARRIER_TIMINGS
qw->bt->summarize_time(0), qw->bt->summarize_time(1), qw->bt->summarize_time(2),
#endif
#if PCM == 1
qw->pvc->summarize_as_string("scan_a"),
qw->pvc->summarize_as_string("scan_b"),
qw->pvc->summarize_as_string("aggr_j"),
qw.bt->summarize_time(0), qw.bt->summarize_time(1), qw.bt->summarize_time(2),
#endif
results[0]);
out_file << std::endl;
iteration = IterateOnce(run, chunk_size, mode);
}
}
numa_free(data_a, workload_b);

Loading…
Cancel
Save