summaryrefslogtreecommitdiff
path: root/BS/baselines
diff options
context:
space:
mode:
Diffstat (limited to 'BS/baselines')
-rw-r--r--BS/baselines/cpu/Makefile2
-rw-r--r--BS/baselines/cpu/bs_omp.c9
-rwxr-xr-xBS/baselines/cpu/run-opti.sh15
3 files changed, 20 insertions, 6 deletions
diff --git a/BS/baselines/cpu/Makefile b/BS/baselines/cpu/Makefile
index 1b0ceb5..8faf3c4 100644
--- a/BS/baselines/cpu/Makefile
+++ b/BS/baselines/cpu/Makefile
@@ -10,6 +10,8 @@ bs_omp_O0: bs_omp.c
bs_omp_O2: bs_omp.c
gcc -O2 bs_omp.c -o bs_omp_O2 -fopenmp
+# bs_omp performs a single iteration and must be run in a loop for proper benchmarks
+
.PHONY: run run_O0 run_O2
run: bs_omp
./bs_omp 262144 16777216
diff --git a/BS/baselines/cpu/bs_omp.c b/BS/baselines/cpu/bs_omp.c
index b8b3023..3775bce 100644
--- a/BS/baselines/cpu/bs_omp.c
+++ b/BS/baselines/cpu/bs_omp.c
@@ -100,16 +100,13 @@ uint64_t binarySearch(DTYPE * input, uint64_t input_size, DTYPE* querys, unsigne
int status = (result_host);
if (status) {
- printf("[::] n_threads=%d e_type=%s n_elements=%d "
- "| throughput_cpu_omp_MBps=%f\n",
+ printf("[::] BS CPU | n_threads=%d e_type=%s n_elements=%d "
+ "| throughput_MBps=%f",
nr_threads, "uint64_t", input_size,
n_querys * sizeof(DTYPE) / timer.time[0]);
- printf("[::] n_threads=%d e_type=%s n_elements=%d "
- "| throughput_cpu_omp_MOpps=%f\n",
+ printf(" throughput_MOpps=%f",
nr_threads, "uint64_t", input_size,
n_querys / timer.time[0]);
- printf("[::] n_threads=%d e_type=%s n_elements=%d |",
- nr_threads, "uint64_t", input_size);
printall(&timer, 0);
} else {
printf("[ERROR]\n");
diff --git a/BS/baselines/cpu/run-opti.sh b/BS/baselines/cpu/run-opti.sh
new file mode 100755
index 0000000..62a3e8b
--- /dev/null
+++ b/BS/baselines/cpu/run-opti.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+HOST="$(hostname)"
+
+echo $HOST
+
+make clean
+
+for i in $(seq 1 50); do
+ make run_O0 | sed 's/CPU/CPU O0/'
+done | tee "${HOST}-O0.txt"
+
+for i in $(seq 1 50); do
+ make run_O2 | sed 's/CPU/CPU O2/'
+done | tee "${HOST}-O2.txt"