margo-p2p-latency-avg-only.patch 827 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
diff --git a/tests/perf-regression/margo-p2p-latency.c b/tests/perf-regression/margo-p2p-latency.c
index e5827eb..fc238f4 100644
--- a/tests/perf-regression/margo-p2p-latency.c
+++ b/tests/perf-regression/margo-p2p-latency.c
@@ -355,13 +355,17 @@ static int run_benchmark(int iterations, hg_id_t id, ssg_member_id_t target,
     ret = margo_create(mid, target_addr, id, &handle);
     assert(ret == 0);
 
+    tm1 = ABT_get_wtime();
     for(i=0; i<iterations; i++)
     {
-        tm1 = ABT_get_wtime();
         ret = margo_forward(handle, NULL);
-        tm2 = ABT_get_wtime();
         assert(ret == 0);
-        measurement_array[i] = tm2-tm1;
+    }
+    tm2 = ABT_get_wtime();
+
+    for(i=0; i<iterations; i++)
+    {
+        measurement_array[i] = (tm2-tm1)/((double)iterations);
     }
 
     margo_destroy(handle);