diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2023-06-02 15:27:22 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2023-06-02 15:27:22 +0200 |
commit | 7e0597a2ddb2d07ff7b72a6fa47245774e04f964 (patch) | |
tree | 51dbd792f11428c5f61283fb5de3fc7d4f9606f7 /HST-S/baselines/cpu | |
parent | f438d54780af4ae90638f5d57acdd5e98d6596e9 (diff) |
port HST-S to dfatool
Diffstat (limited to 'HST-S/baselines/cpu')
-rw-r--r-- | HST-S/baselines/cpu/Makefile | 24 | ||||
-rw-r--r-- | HST-S/baselines/cpu/app_baseline.c | 21 | ||||
-rwxr-xr-x | HST-S/baselines/cpu/run-opti.sh | 15 | ||||
-rwxr-xr-x | HST-S/baselines/cpu/run.sh | 24 |
4 files changed, 77 insertions, 7 deletions
diff --git a/HST-S/baselines/cpu/Makefile b/HST-S/baselines/cpu/Makefile index 708ae72..4405afc 100644 --- a/HST-S/baselines/cpu/Makefile +++ b/HST-S/baselines/cpu/Makefile @@ -1,6 +1,24 @@ -all: - gcc -o hist -fopenmp app_baseline.c +all: hist + +hist: app_baseline.c + gcc -O2 -o hist -fopenmp app_baseline.c + +hist_O0: app_baseline.c + gcc -o hist_O0 -fopenmp app_baseline.c + +hist_O2: app_baseline.c + gcc -O2 -o hist_O2 -fopenmp app_baseline.c + +run: hist + ./hist -i 1006632960 -t 4 + +run_O0: hist_O0 + ./hist_O0 -i 1006632960 -t 4 + +run_O2: hist_O2 + ./hist_O2 -i 1006632960 -t 4 clean: - rm hist + rm -f hist hist_O0 hist_O2 +.PHONY: all run run_O0 run_O2 clean diff --git a/HST-S/baselines/cpu/app_baseline.c b/HST-S/baselines/cpu/app_baseline.c index 8ae2c12..d67b6b3 100644 --- a/HST-S/baselines/cpu/app_baseline.c +++ b/HST-S/baselines/cpu/app_baseline.c @@ -23,6 +23,9 @@ #include "../../support/common.h" #include "../../support/timer.h" +#define XSTR(x) STR(x) +#define STR(x) #x + // Pointer declaration static T* A; static unsigned int* histo_host; @@ -180,9 +183,19 @@ int main(int argc, char **argv) { histogram_host(histo_host, A, p.bins, input_size, p.exp, nr_of_dpus, p.n_threads); stop(&timer, 0); - printf("Kernel "); - print(&timer, 0, 1); - printf("\n"); - + + unsigned int nr_threads = 0; +#pragma omp parallel +#pragma omp atomic + nr_threads++; + + printf("[::] HST-S CPU | n_threads=%d e_type=%s n_elements=%d n_bins=%d " + "| throughput_MBps=%f", + nr_threads, XSTR(T), input_size, p.exp ? p.bins : p.bins * nr_of_dpus, + input_size * sizeof(T) / timer.time[0]); + printf(" throughput_MOpps=%f", + input_size / timer.time[0]); + printall(&timer, 0); + return 0; } diff --git a/HST-S/baselines/cpu/run-opti.sh b/HST-S/baselines/cpu/run-opti.sh new file mode 100755 index 0000000..62a3e8b --- /dev/null +++ b/HST-S/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" diff --git a/HST-S/baselines/cpu/run.sh b/HST-S/baselines/cpu/run.sh new file mode 100755 index 0000000..36fd28b --- /dev/null +++ b/HST-S/baselines/cpu/run.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +HOST="$(hostname)" + +echo $HOST + +( +echo "prim-benchmarks HST-S CPU (dfatool edition)" +echo "Started at $(date)" +echo "Revision $(git describe --always)" + +# baseline ./hist supports -x, however -x 0 references uninitialized variables +# and likely never has been used or tested. So we'll leave that out here. + +make -B verbose=1 + +for nr_threads in 88 64 44 32 24 20 1 2 4 6 8 12 16; do + for i in `seq 1 20`; do + timeout --foreground -k 1m 30m ./hist -t ${nr_threads} -i 1006632960 || true + done +done +) | tee "${HOST}-explore.txt" |