summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2023-04-28 10:31:19 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2023-04-28 10:31:19 +0200
commit490dc079c0374ee2a290a06c42e6ad7e9ca1fa22 (patch)
tree184ea7383c065c00822d8a0e48c4c03b11a27346
parent210cf79cdddda090c5ed45e29b32efee73c50494 (diff)
produce dfatool-compatible output, add run script
-rw-r--r--mbw.c16
-rwxr-xr-xrun.sh14
2 files changed, 21 insertions, 9 deletions
diff --git a/mbw.c b/mbw.c
index 06b7fd9..ca439ce 100644
--- a/mbw.c
+++ b/mbw.c
@@ -14,7 +14,7 @@
#include <unistd.h>
/* how many runs to average by default */
-#define DEFAULT_NR_LOOPS 10
+#define DEFAULT_NR_LOOPS 40
/* we have 3 tests at the moment */
#define MAX_TESTS 3
@@ -28,7 +28,7 @@
#define TEST_MCBLOCK 2
/* version number */
-#define VERSION "1.5"
+#define VERSION "1.5+smaug"
/*
* MBW memory bandwidth benchmark
@@ -151,18 +151,16 @@ void printout(double te, double mt, int type)
{
switch(type) {
case TEST_MEMCPY:
- printf("Method: MEMCPY\t");
+ printf("e_method=MEMCPY ");
break;
case TEST_DUMB:
- printf("Method: DUMB\t");
+ printf("e_method=DUMB ");
break;
case TEST_MCBLOCK:
- printf("Method: MCBLOCK\t");
+ printf("e_method=MCBLOCK ");
break;
}
- printf("Elapsed: %.5f\t", te);
- printf("MiB: %.5f\t", mt);
- printf("Copy: %.3f MiB/s\n", mt/te);
+ printf("| bandwidth_MiBps=%f\n", mt/te);
return;
}
@@ -287,7 +285,7 @@ int main(int argc, char **argv)
for (i=0; nr_loops==0 || i<nr_loops; i++) {
te=worker(asize, a, b, testno, block_size);
te_sum+=te;
- printf("%d\t", i);
+ printf("[::] block_size_B=%llu array_size_B=%llu ", block_size, asize*long_size);
printout(te, mt, testno);
}
if(showavg) {
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..d30b956
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+ARRSIZE=512
+
+./mbw -t0 ${ARRSIZE}
+./mbw -t1 ${ARRSIZE}
+for blocksize in 8 16 32 64 128 256 512 1024 \
+ $((1024*2)) $((1024*4)) $((1024*8)) $((1024*16)) $((1024*32)) $((1024*64)) \
+ $((1024*128)) $((1024*256)) $((1024*512)) $((1024*1024)) \
+ $((1024*1024*2)) $((1024*1024*4)) $((1024*1024*8)) $((1024*1024*16)); do
+ ./mbw -b $blocksize -t2 ${ARRSIZE}
+done