summaryrefslogtreecommitdiff
path: root/Microbenchmarks/CPU-DPU/host/app.c
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/CPU-DPU/host/app.c
parentbfd5d0dcd2723ae7879f34f4310f0cbaf97e9557 (diff)
Allow benchmarking with #ranks instead of #dpus
Diffstat (limited to 'Microbenchmarks/CPU-DPU/host/app.c')
-rw-r--r--Microbenchmarks/CPU-DPU/host/app.c10
1 files changed, 8 insertions, 2 deletions
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;