summaryrefslogtreecommitdiff
path: root/Microbenchmarks
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-06-07 10:49:07 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-06-07 10:57:00 +0200
commit0f0243a8e9ca87b7ce5d5ffc2fb567508dbde270 (patch)
tree6e0e0526c4ec99fd423febf31c79ccd92f9c91f0 /Microbenchmarks
parentbfd5d0dcd2723ae7879f34f4310f0cbaf97e9557 (diff)
Allow benchmarking with #ranks instead of #dpus
Diffstat (limited to 'Microbenchmarks')
-rw-r--r--Microbenchmarks/CPU-DPU/Makefile5
-rw-r--r--Microbenchmarks/CPU-DPU/host/app.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/Microbenchmarks/CPU-DPU/Makefile b/Microbenchmarks/CPU-DPU/Makefile
index f354e67..f758d74 100644
--- a/Microbenchmarks/CPU-DPU/Makefile
+++ b/Microbenchmarks/CPU-DPU/Makefile
@@ -1,6 +1,7 @@
NR_TASKLETS ?= 16
BL ?= 8
-NR_DPUS ?= 1
+NR_DPUS ?= 0
+NR_RANKS ?= 0
TRANSFER ?= PUSH
DPU_BINARY ?= '"bin/dpu_code"'
@@ -8,7 +9,7 @@ COMMON_INCLUDES := support
HOST_SOURCES := $(wildcard host/*.c)
COMMON_FLAGS := -Wall -Wextra -g -I${COMMON_INCLUDES}
-HOST_FLAGS := ${COMMON_FLAGS} -D_POSIX_C_SOURCE=200809L -std=c11 -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TRANSFER} -DDPU_BINARY=${DPU_BINARY}
+HOST_FLAGS := ${COMMON_FLAGS} -D_POSIX_C_SOURCE=200809L -std=c11 -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DNR_RANKS=${NR_RANKS} -DBL=${BL} -D${TRANSFER} -DDPU_BINARY=${DPU_BINARY}
DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS} -DBL=${BL} -D${TRANSFER}
QUIET = @
diff --git a/Microbenchmarks/CPU-DPU/host/app.c b/Microbenchmarks/CPU-DPU/host/app.c
index 7ef5f21..401722f 100644
--- a/Microbenchmarks/CPU-DPU/host/app.c
+++ b/Microbenchmarks/CPU-DPU/host/app.c
@@ -68,7 +68,13 @@ int main(int argc, char **argv) {
snprintf(ntpp, 24, "nrThreadPerPool=%d", p.n_threads);
// Allocate DPUs and load binary
start(&timer, 4, 0);
+#if NR_DPUS
DPU_ASSERT(dpu_alloc(NR_DPUS, ntpp, &dpu_set));
+#elif NR_RANKS
+ DPU_ASSERT(dpu_alloc_ranks(NR_RANKS, ntpp, &dpu_set));
+#else
+#error "NR_DPUS o NR_RANKS must be set"
+#endif
stop(&timer, 4);
start(&timer, 5, 0);
DPU_ASSERT(dpu_load(dpu_set, DPU_BINARY, NULL));
@@ -175,7 +181,7 @@ int main(int argc, char **argv) {
#ifdef BROADCAST
nr_of_dpus, nr_of_ranks, NR_TASKLETS, p.n_nops, p.n_instr, XSTR(T), transfer_size, transfer_size, transfer_mode,
#else
- nr_of_dpus, nr_of_ranks, NR_TASKLETS, p.n_nops, p.n_instr, XSTR(T), transfer_size, transfer_size / NR_DPUS, transfer_mode,
+ nr_of_dpus, nr_of_ranks, NR_TASKLETS, p.n_nops, p.n_instr, XSTR(T), transfer_size, transfer_size / nr_of_dpus, transfer_mode,
#endif
timer.nanoseconds[1], timer.nanoseconds[3],
transfer_size * sizeof(T) * 1e9 / timer.nanoseconds[1],
@@ -190,7 +196,7 @@ int main(int argc, char **argv) {
// Check output
bool status = true;
-#ifdef BROADCASTX
+#ifdef BROADCAST
for (i = 0; i < input_size/nr_of_dpus; i++) {
if(B[i] != bufferC[i]){
status = false;