Perform some cleanups on matrix_mult:

  - remove unused ops local from matrix_mult().
  - remove unused timing calculation from matrix_mult().
  - streamline parenthesis use in matrix_mult().
  - cleanup stray '\' in the stats_container_save() calls.
  - remove one commented out join_threads().

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

diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c 
b/testcases/realtime/func/matrix_mult/matrix_mult.c
index 7c3c6b6..5577a51 100644
--- a/testcases/realtime/func/matrix_mult/matrix_mult.c
+++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
@@ -101,24 +101,16 @@ void matrix_mult(void)
        float B[MATRIX_SIZE][MATRIX_SIZE];
        float C[MATRIX_SIZE][MATRIX_SIZE];
        int i, j, k;
-       nsec_t start, end, delta;
-       int ops;
 
        matrix_init(A, B);
-       start = rt_gettime();
-       ops = 0;
-       for (i = 0; i < MATRIX_SIZE; i++)
-       {
-               for (j = 0; j < MATRIX_SIZE; j++)
-               {
+
+       for (i = 0; i < MATRIX_SIZE; i++) {
+               for (j = 0; j < MATRIX_SIZE; j++) {
                        for (k = 0; k < MATRIX_SIZE; k++) {
                                C[i][j] += A[i][k]*B[k][j];
-                               ops++;
                        }
                }
        }
-       end = rt_gettime();
-       delta = end - start;
 }
 
 /* arg: the number of concurrent threads being run */
@@ -201,10 +193,10 @@ int main(int argc, char *argv[])
        printf("StdDev: %.4f us\n", stats_stddev(&sdat));
        stats_hist(&shist, &sdat);
 
-       stats_container_save("sequential", "Matrix Multiplication Sequential 
Execution Runtime Scatter Plot",\
-                               "Iteration", "Runtime (us)", &sdat, "points");
-       stats_container_save("sequential_hist", "Matrix Multiplicatoin 
Sequential Execution Runtime Histogram",\
-                               "Iteration", "Runtime (us)", &shist, "steps");
+       stats_container_save("sequential", "Matrix Multiplication Sequential 
Execution Runtime Scatter Plot",
+                            "Iteration", "Runtime (us)", &sdat, "points");
+       stats_container_save("sequential_hist", "Matrix Multiplicatoin 
Sequential Execution Runtime Histogram",
+                            "Iteration", "Runtime (us)", &shist, "steps");
 
        // run matrix mult operation concurrently
        printf("\nConcurrent (%dx):\n", numcpus);
@@ -244,18 +236,16 @@ int main(int argc, char *argv[])
        printf("StdDev: %.4f us\n", stats_stddev(&cdat));
        stats_hist(&chist, &cdat);
 
-       stats_container_save("concurrent", "Matrix Multiplication Concurrent 
Execution Runtime Scatter Plot",\
-                               "Iteration", "Runtime (us)", &cdat, "points");
-       stats_container_save("concurrent_hist", "Matrix Multiplication 
Concurrent Execution Runtime Histogram",\
-                               "Iteration", "Runtime (us)", &chist, "steps");
+       stats_container_save("concurrent", "Matrix Multiplication Concurrent 
Execution Runtime Scatter Plot",
+                            "Iteration", "Runtime (us)", &cdat, "points");
+       stats_container_save("concurrent_hist", "Matrix Multiplication 
Concurrent Execution Runtime Histogram",
+                            "Iteration", "Runtime (us)", &chist, "steps");
 
        printf("\nSeq/Conc Ratios:\n");
        printf("Min: %.4f\n", (float)smin/cmin);
        printf("Max: %.4f\n", (float)smax/cmax);
        printf("Avg: %.4f\n", (float)savg/cavg);
 
-       //join_threads();
-
        ret = 1;
        if (savg > (cavg * criteria))
                ret = 0;
-- 
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