summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-07-05 11:34:18 +0200
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-07-05 11:34:18 +0200
commitf5377a304ba5390400ebff633f162212d3c7ab5d (patch)
tree41de28e6c0b5cf0d3393ae4adcc4c40572a3d45f
parent48978a7ed71b7c537015214f3ac08fb5b9d182f2 (diff)
GEMV: log rank NUMA node
-rwxr-xr-xGEMV/dimes-hetsim.sh30
-rw-r--r--GEMV/host/app.c26
2 files changed, 24 insertions, 32 deletions
diff --git a/GEMV/dimes-hetsim.sh b/GEMV/dimes-hetsim.sh
deleted file mode 100755
index d7163d5..0000000
--- a/GEMV/dimes-hetsim.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-
-cd baselines/cpu
-make -B NUMA=1
-
-mkdir -p log/$(hostname)
-fn=log/$(hostname)/$(date +%Y%m%d)-baseline.txt
-
-# gemv hardcodes 167772160 double elements → 1.25 GiB of data
-
-(
-
-for i in `seq 1 20`; do
- for nr_threads in 1 2 4 8 12 16; do
- for cpu in 0 1 2 3 4 5 6 7; do
- for ram in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
- OMP_NUM_THREADS=$nr_threads ./gemv $ram $ram $cpu
- done
- done
- done
- for nr_threads in 32 48 64 96 128; do
- for ram in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
- OMP_NUM_THREADS=$nr_threads ./gemv $ram $ram -1
- done
- done
-done
-
-) | tee $fn
-
-xz -f -v -9 -M 800M $fn
diff --git a/GEMV/host/app.c b/GEMV/host/app.c
index d96315a..ef0f2e5 100644
--- a/GEMV/host/app.c
+++ b/GEMV/host/app.c
@@ -18,6 +18,9 @@
#include <dpu_probe.h>
#endif
+#include <dpu_management.h>
+#include <dpu_target_macros.h>
+
#define XSTR(x) STR(x)
#define STR(x) #x
@@ -77,6 +80,8 @@ int main(int argc, char **argv) {
// Timer
Timer timer;
+ int numa_node_rank = -2;
+
// Allocate DPUs and load binary
#if !WITH_ALLOC_OVERHEAD
DPU_ASSERT(dpu_alloc(NR_DPUS, NULL, &dpu_set));
@@ -179,6 +184,23 @@ int main(int argc, char **argv) {
assert(nr_of_dpus == NR_DPUS);
#endif
+ // int prev_rank_id = -1;
+ int rank_id = -1;
+ DPU_FOREACH (dpu_set, dpu) {
+ rank_id = dpu_get_rank_id(dpu_get_rank(dpu_from_set(dpu))) & DPU_TARGET_MASK;
+ if ((numa_node_rank != -2) && numa_node_rank != dpu_get_rank_numa_node(dpu_get_rank(dpu_from_set(dpu)))) {
+ numa_node_rank = -1;
+ } else {
+ numa_node_rank = dpu_get_rank_numa_node(dpu_get_rank(dpu_from_set(dpu)));
+ }
+ /*
+ if (rank_id != prev_rank_id) {
+ printf("/dev/dpu_rank%d @ NUMA node %d\n", rank_id, numa_node_rank);
+ prev_rank_id = rank_id;
+ }
+ */
+ }
+
if(rep >= p.n_warmup) {
start(&timer, 2, 0);
}
@@ -286,8 +308,8 @@ int main(int argc, char **argv) {
if (rep >= p.n_warmup) {
printf("[::] GEMV UPMEM | n_dpus=%d n_ranks=%d n_tasklets=%d e_type=%s block_size_B=%d n_elements=%d",
NR_DPUS, nr_of_ranks, NR_TASKLETS, XSTR(T), BLOCK_SIZE, n_size * m_size);
- printf(" b_with_alloc_overhead=%d b_with_load_overhead=%d b_with_free_overhead=%d ",
- WITH_ALLOC_OVERHEAD, WITH_LOAD_OVERHEAD, WITH_FREE_OVERHEAD);
+ printf(" b_with_alloc_overhead=%d b_with_load_overhead=%d b_with_free_overhead=%d numa_node_rank=%d ",
+ WITH_ALLOC_OVERHEAD, WITH_LOAD_OVERHEAD, WITH_FREE_OVERHEAD, numa_node_rank);
printf("| latency_alloc_us=%f latency_load_us=%f latency_cpu_us=%f latency_write_us=%f latency_kernel_us=%f latency_read_us=%f latency_free_us=%f",
timer.time[0],
timer.time[1],