summaryrefslogtreecommitdiff
path: root/Microbenchmarks/Arithmetic-Throughput/host/app.c
diff options
context:
space:
mode:
authorBirte Friesel <dfriesel@uos.de>2023-07-24 09:49:57 +0200
committerBirte Friesel <dfriesel@uos.de>2023-07-24 09:50:42 +0200
commitd2ef1985df82442feacadb2d62eae103c379bbcb (patch)
treebe139a750b1eb68bbd70f94c8fecf33090f636d1 /Microbenchmarks/Arithmetic-Throughput/host/app.c
parent767210829d2b54323ec860c6e9a62f84353a2319 (diff)
Arithmetic Throughput Microbenchmark: Identify rank/slice/member of faulty DPUs
Diffstat (limited to 'Microbenchmarks/Arithmetic-Throughput/host/app.c')
-rw-r--r--Microbenchmarks/Arithmetic-Throughput/host/app.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/Microbenchmarks/Arithmetic-Throughput/host/app.c b/Microbenchmarks/Arithmetic-Throughput/host/app.c
index 5933d1d..514b207 100644
--- a/Microbenchmarks/Arithmetic-Throughput/host/app.c
+++ b/Microbenchmarks/Arithmetic-Throughput/host/app.c
@@ -22,6 +22,11 @@
#define DPU_BINARY "./bin/dpu_code"
#endif
+#if PRINT
+#include <dpu_management.h>
+#include <dpu_target_macros.h>
+#endif
+
// Pointer declaration
static T* A;
static T* B;
@@ -200,11 +205,26 @@ int main(int argc, char **argv) {
// Check output
bool status = true;
- for (i = 0; i < input_size; i++) {
- if(C2[i] != bufferB[i]){
+ for (unsigned int j = 0; j < input_size; j++) {
+ if(C2[j] != bufferB[j]){
status = false;
+
#if PRINT
- printf("%d: %u -- %u\n", i, C2[i], bufferB[i]);
+ const unsigned int input_size_dpu = input_size / nr_of_dpus;
+ int rank = -1;
+ int slice = -1;
+ int member = -1;
+ i = 0;
+ unsigned int dpu_id = j / input_size_dpu;
+ DPU_FOREACH (dpu_set, dpu) {
+ if (i == dpu_id) {
+ rank = dpu_get_rank_id(dpu_get_rank(dpu_from_set(dpu))) & DPU_TARGET_MASK;
+ slice = dpu_get_slice_id(dpu_from_set(dpu));
+ member = dpu_get_member_id(dpu_from_set(dpu));
+ }
+ i++;
+ }
+ printf("DPU %d (rank %d slice.member %d.%d) at offset %d: %u -- %u\n", j / input_size_dpu, rank, slice, member, j % input_size_dpu, C2[j], bufferB[j]);
#endif
}
}