summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-12-10 15:27:32 +0100
committerTimo Dritschler <timo.dritschler@kit.edu>2014-12-10 15:27:32 +0100
commit50a297a290c78c7feb0a4918efba82edd019590b (patch)
tree2407fb62f377a2212df46fdae5f13b9219a2adac /test
parentb948c151b9f45db2b90a9ecf95ffd4f54edf3924 (diff)
downloadkiro-50a297a290c78c7feb0a4918efba82edd019590b.tar.gz
kiro-50a297a290c78c7feb0a4918efba82edd019590b.tar.bz2
kiro-50a297a290c78c7feb0a4918efba82edd019590b.tar.xz
kiro-50a297a290c78c7feb0a4918efba82edd019590b.zip
Fixed KIRO client getting stuck in the RDMA event handler
Fix #8: KIRO Server and Client now have routines to handle async communication Fix #6: Added kiro_client_ping_server and respective event handling to server Changed kiro-test-latency to use the new kiro_client_ping_server instead
Diffstat (limited to 'test')
-rw-r--r--test/test-client-latency.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/test/test-client-latency.c b/test/test-client-latency.c
index d05747d..208c37c 100644
--- a/test/test-client-latency.c
+++ b/test/test-client-latency.c
@@ -6,7 +6,7 @@
#include <assert.h>
-int
+int
main ( int argc, char *argv[] )
{
if (argc < 3) {
@@ -15,38 +15,30 @@ main ( int argc, char *argv[] )
}
KiroClient *client = kiro_client_new ();
- KiroTrb *trb = kiro_trb_new ();
if (-1 == kiro_client_connect (client, argv[1], argv[2])) {
kiro_client_free (client);
return -1;
}
- kiro_client_sync (client);
- kiro_trb_adopt (trb, kiro_client_get_memory (client));
+ int iterations = 10000;
- GTimer *timer = g_timer_new ();
-while (1) {
- g_timer_reset (timer);
+while (1) {
int i = 0;
- while(i < 50000) {
- kiro_client_sync (client);
+ float ping_us = 0;
+ int fail_count = 0;
+ while(i < iterations) {
+ float tmp = kiro_client_ping_server (client);
+ if (tmp < 0)
+ fail_count++;
+ else
+ ping_us += tmp;
i++;
}
- double elapsed = g_timer_elapsed (timer, NULL);
- printf ("Average Latency: %fus\n", (elapsed/50000.)*1000*1000);
+ printf ("Average Latency: %fus\n", ping_us/(float)(iterations - fail_count));
}
- g_timer_stop (timer);
kiro_client_free (client);
- kiro_trb_free (trb);
return 0;
}
-
-
-
-
-
-
-