summaryrefslogtreecommitdiffstats
path: root/test/test-client-bandwith.c
diff options
context:
space:
mode:
authorTimo <timo.dritschler@kit.edu>2014-09-30 14:55:26 +0200
committerTimo <timo.dritschler@kit.edu>2014-09-30 14:55:26 +0200
commite71b75575658c435bc77c01ef098336c563af740 (patch)
treedd2d852820339cf84df216e62a76ebbda9d32fc0 /test/test-client-bandwith.c
parent6ffe22890f901238318c68c38c099ccd62321a9a (diff)
downloadkiro-e71b75575658c435bc77c01ef098336c563af740.tar.gz
kiro-e71b75575658c435bc77c01ef098336c563af740.tar.bz2
kiro-e71b75575658c435bc77c01ef098336c563af740.tar.xz
kiro-e71b75575658c435bc77c01ef098336c563af740.zip
Fixed a bug in RDMA memory allocation (Size information was missing)
Added test-latency and test-bandwith tests
Diffstat (limited to 'test/test-client-bandwith.c')
-rw-r--r--test/test-client-bandwith.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/test-client-bandwith.c b/test/test-client-bandwith.c
new file mode 100644
index 0000000..c7f90ee
--- /dev/null
+++ b/test/test-client-bandwith.c
@@ -0,0 +1,53 @@
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "kiro-client.h"
+#include "kiro-trb.h"
+#include <assert.h>
+
+
+int
+main ( int argc, char *argv[] )
+{
+ if (argc < 3) {
+ printf ("Not enough aruments. Usage: ./client <address> <port>\n");
+ return -1;
+ }
+
+ KiroClient *client = kiro_client_new ();
+
+ if (-1 == kiro_client_connect (client, argv[1], argv[2])) {
+ g_object_unref (client);
+ return -1;
+ }
+
+ kiro_client_sync (client);
+ KiroTrb *trb = kiro_trb_new ();
+ kiro_trb_adopt (trb, kiro_client_get_memory (client));
+
+ GTimer *timer = g_timer_new ();
+
+
+while (1) {
+ int i = 0;
+ while(i < 500) {
+ kiro_client_sync (client);
+ i++;
+ }
+
+ double elapsed = g_timer_elapsed (timer, NULL);
+ size_t size = kiro_client_get_memory_size (client);
+ printf ("Throughput: %.2fGbyte/s\n",((size * 500) / elapsed)/(1024*1024*1024));
+}
+ g_timer_stop (timer);
+ g_object_unref (client);
+ return 0;
+}
+
+
+
+
+
+
+
+