summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-05-14 13:43:55 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-05-14 13:43:55 +0200
commit4052d7b4c0e1a59419f07642b9a33088f5745d28 (patch)
tree23fb0907d1ffad55331e0e8fcf71ac2d876f4851 /include
parentaed00e149b8a3677a89416eaa112ea6c5249150b (diff)
BFS: AspectC++ (and behaviour model) support
Diffstat (limited to 'include')
-rw-r--r--include/dfatool_host_dpu.ah20
-rw-r--r--include/timer_base.h11
2 files changed, 30 insertions, 1 deletions
diff --git a/include/dfatool_host_dpu.ah b/include/dfatool_host_dpu.ah
index 0e03d31..010c18c 100644
--- a/include/dfatool_host_dpu.ah
+++ b/include/dfatool_host_dpu.ah
@@ -12,6 +12,8 @@ aspect DfatoolHostDPUTiming {
double const M_to_Mi = 1.048576; /* 2^20 / 1e6 */
+ virtual int getKernel() = 0;
+
advice call("% dpu_get_nr_dpus(...)") : after() {
n_dpus = **(tjp->arg<1>());
}
@@ -79,7 +81,7 @@ aspect DfatoolHostDPUTiming {
tjp->filename(),
tjp->line(),
n_dpus, n_ranks,
- kernel + 1,
+ getKernel(),
input_size,
input_size / n_dpus,
latency_us,
@@ -104,6 +106,22 @@ aspect DfatoolHostDPUTiming {
);
}
+ advice call("% dpu_copy_from(...)") : around() {
+ size_t payload_size = *(tjp->arg<4>());
+ gettimeofday(&starttime, NULL);
+ tjp->proceed();
+ gettimeofday(&stoptime, NULL);
+ double time_us = (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec);
+ printf("[::] dpu_copy_from @ %s:%d | n_dpus=%u n_ranks=%u payload_B=%lu | latency_us=%f throughput_MiBps=%f\n",
+ tjp->filename(),
+ tjp->line(),
+ n_dpus, n_ranks,
+ payload_size,
+ time_us,
+ payload_size / (time_us * M_to_Mi)
+ );
+ }
+
advice call("% dpu_push_xfer(...)") : around() {
size_t payload_size = *(tjp->arg<4>());
gettimeofday(&starttime, NULL);
diff --git a/include/timer_base.h b/include/timer_base.h
index fed8bec..dcc73b7 100644
--- a/include/timer_base.h
+++ b/include/timer_base.h
@@ -31,6 +31,11 @@ void stop(Timer *timer, int i)
(timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec);
}
+void zero(Timer *timer, int i)
+{
+ timer->time[0] = 0;
+}
+
#else
#define dfatool_printf(fmt, ...) do {} while (0)
@@ -50,4 +55,10 @@ void stop(Timer *timer, int i)
(void)i;
}
+void zero(Timer *timer, int i)
+{
+ (void)timer;
+ (void)i;
+}
+
#endif