The timing measurements take into account threads creation and
joining which are performed at SCHED_OTHER priority. This introduce
latency artifacts in what we intend to measure.

  To minimize this effect, bump the main thread priority to just above the
matrixmult_thread threads priority (i.e. PRIO + 1).

  These effects are particularly visible from the concurrent runs as well as
the Sequential/Concurrent ratios which exhibit large discrepancies between
min, max and average values.

  - without patch:
        Sequential:
        Min: 297858 us
        Max: 298181 us
        Avg: 297920.9688 us
        StdDev: 54.9808

        Concurrent (8x):
        Min: 38137 us
        Max: 75575 us
        Avg: 53347.6719 us
        StdDev: 17647.2676

        Seq/Conc Ratios:
        Min: 7.8102
        Max: 3.9455
        Avg: 5.5845

  - with patch:
        Sequential:
        Min: 297850 us
        Max: 298106 us
        Avg: 297916.9375 us
        StdDev: 42.2170 us

        Concurrent (8x):
        Min: 38128 us
        Max: 39023 us
        Avg: 38211.1992 us
        StdDev: 91.1165 us

        Seq/Conc Ratios:
        Min: 7.8118
        Max: 7.6392
        Avg: 7.7966

Signed-off-by: Sebastien Dugue <[EMAIL PROTECTED]>
Cc: Darren Hart <[EMAIL PROTECTED]>
Cc: Tim Chavez <[EMAIL PROTECTED]>
---
 testcases/realtime/func/matrix_mult/matrix_mult.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c 
b/testcases/realtime/func/matrix_mult/matrix_mult.c
index 5577a51..581aa00 100644
--- a/testcases/realtime/func/matrix_mult/matrix_mult.c
+++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
@@ -135,6 +135,8 @@ int main(int argc, char *argv[])
        int ret;
        int numcpus;
        int criteria;
+       struct sched_param param;
+
        setup();
        rt_init("jl:h", parse_args, argc, argv);
        numcpus = sysconf(_SC_NPROCESSORS_ONLN);
@@ -165,6 +167,12 @@ int main(int argc, char *argv[])
        stats_container_init(&cdat, ITERATIONS);
        stats_container_init(&chist, HIST_BUCKETS);
 
+       param.sched_priority = PRIO + 1;
+       if (sched_setscheduler(0, SCHED_FIFO, &param) != 0) {
+               perror("sched_setscheduler");
+               return -1;
+       }
+
        // run matrix mult operation sequentially
        printf("\nSequential:\n");
        for (i = 0; i < ITERATIONS; i++) {
-- 
1.5.4.rc2.84.gf85fd-dirty


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to