int main() { bench_mem(); bench_noc(); return 0; }
void payload_benchmark() { /* * count and collect all processors (collective barrier) */ if (CPU_ID == 0) smm_deactivate(); // ...and (try to) deactivate SMM /* * Memory allocation */ init_buffers(); barrier(&global_barrier); /* * Benchmarks */ bench_hourglass(); bench_hourglass_worker(p_contender); bench_hourglass_hyperthread(); barrier(&global_barrier); bench_worker(p_buffer, p_contender); bench_worker_cut(p_buffer, p_contender, 16*KB); if (CPU_ID == 0) { heap_reconfig(p_buffer, buffer_size, 0); heap_reconfig(p_contender, contender_size, MM_CACHE_DISABLE); barrier(&global_barrier); printf("======== Benchmark: WB / Load: CD ===================================\n"); } else { barrier(&global_barrier); tlb_shootdown(p_buffer, buffer_size); tlb_shootdown(p_contender, contender_size); } barrier(&global_barrier); bench_worker_cut(p_buffer, p_contender, 16*KB); bench_worker_cut(p_buffer, p_contender, 128*KB); if (CPU_ID == 0) { heap_reconfig(p_buffer, buffer_size, 0); heap_reconfig(p_contender, contender_size, MM_WRITE_THROUGH); barrier(&global_barrier); printf("======== Benchmark: WB / Load: WT ===================================\n"); } else { barrier(&global_barrier); tlb_shootdown(p_buffer, buffer_size); tlb_shootdown(p_contender, contender_size); } barrier(&global_barrier); bench_worker_cut(p_buffer, p_contender, 16*KB); bench_worker_cut(p_buffer, p_contender, 128*KB); barrier(&global_barrier); bench_mem(p_buffer, p_contender); bench_rangestride(p_buffer); }
void payload_benchmark_menu() { int t = 0, r; unsigned flag = 0; menu_entry_t testmenu[] = { {1, "reconfig p_buffer"}, {2, "reconfig p_contender"}, {3, "reconfig timebase"}, {4, "hourglass"}, {5, "bench_worker"}, {6, "bench_worker_cut(16 kB)"}, {7, "bench_mem"}, {8, "bench_rangestride"}, {999, "return"}, {0,0} }; menu_entry_t reconfmenu[] = { {cm_cache_disable, "cache disable"}, {cm_write_back, "write back"}, {cm_write_through, "write through"}, {999, "abort"}, {0,0} }; menu_entry_t timebasemenu[] = { {1, " 1 Sec."}, {2, " 2 Sec."}, {5, " 5 Sec."}, {10, "10 Sec."}, {30, "30 Sec."}, {999, "abort"}, {0,0} }; /* * Memory allocation */ init_buffers(); barrier(&global_barrier); do { t = menu("Benchmarks", testmenu, t); switch (t) { case 1 : r = menu("p_buffer", reconfmenu, bench_opt.cm_buffer); switch (r) { case 1 : flag = MM_CACHE_DISABLE; bench_opt.cm_buffer = r; break; case 2 : flag = MM_WRITE_THROUGH; bench_opt.cm_buffer = r; break; case 3 : flag = 0; bench_opt.cm_buffer = r; break; } if (r != 999) heap_reconfig(p_buffer, buffer_size, flag); break; case 2 : r = menu("p_contender", reconfmenu, bench_opt.cm_contender); switch (r) { case 1 : flag = MM_CACHE_DISABLE; bench_opt.cm_contender = r; break; case 2 : flag = MM_WRITE_THROUGH; bench_opt.cm_contender = r; break; case 3 : flag = 0; bench_opt.cm_contender = r; break; } if (r != 999) heap_reconfig(p_contender, contender_size, flag); break; case 3 : r = menu("timebase", timebasemenu, bench_opt.timebase); if (r != 999) bench_opt.timebase = r; break; case 4 : bench_hourglass(); break; case 5 : bench_worker(p_buffer, p_contender); break; case 6 : bench_worker_cut(p_buffer, p_contender, 16*KB); break; case 7 : bench_mem(p_buffer, p_contender); break; case 8 : bench_rangestride(p_buffer); break; } } while (t != 999); }