From: Gilles C. <gil...@bu...> - 2008-03-11 10:30:35
|
Signed-off-by: Gilles Carry <gil...@bu...> Cc: Darren Hart <dv...@us...> Cc: Tim Chavez <ti...@us...> --- testcases/realtime/func/matrix_mult/matrix_mult.c | 44 ++++++++++++++------- 1 files changed, 30 insertions(+), 14 deletions(-) diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c b/testcases/realtime/func/matrix_mult/matrix_mult.c index 1a9ce80..6ea68b6 100644 --- a/testcases/realtime/func/matrix_mult/matrix_mult.c +++ b/testcases/realtime/func/matrix_mult/matrix_mult.c @@ -135,6 +135,7 @@ int main(int argc, char *argv[]) int ret; int numcpus; int criteria; + setup(); rt_init("jl:h", parse_args, argc, argv); numcpus = sysconf(_SC_NPROCESSORS_ONLN); @@ -160,10 +161,15 @@ int main(int argc, char *argv[]) stats_container_t sdat, cdat; stats_container_t shist, chist; - stats_container_init(&sdat, ITERATIONS); - stats_container_init(&shist, HIST_BUCKETS); - stats_container_init(&cdat, ITERATIONS); - stats_container_init(&chist, HIST_BUCKETS); + if ( stats_container_init(&sdat, ITERATIONS) || + stats_container_init(&shist, HIST_BUCKETS) || + stats_container_init(&cdat, ITERATIONS) || + stats_container_init(&chist, HIST_BUCKETS) + ) + { + fprintf (stderr, "Cannot init stats container\n"); + exit(1); + } // run matrix mult operation sequentially printf("\nSequential:\n"); @@ -191,12 +197,17 @@ int main(int argc, char *argv[]) printf("Max: %ld us\n", smax); printf("Avg: %.4f us\n", savg); 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", - "Runtime (us)", "Samples", &shist, "steps"); + if ( + 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", + "Runtime (us)", "Samples", &shist, "steps") + ) { + fprintf(stderr, "Warning: could not save sequential mults stats\n"); + } // run matrix mult operation concurrently printf("\nConcurrent (%dx):\n", numcpus); @@ -234,12 +245,17 @@ int main(int argc, char *argv[]) printf("Max: %ld us\n", cmax); printf("Avg: %.4f us\n", cavg); 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"); + if ( + 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") + ) { + fprintf(stderr, "Warning: could not save concurrent mults stats\n"); + } printf("\nSeq/Conc Ratios:\n"); printf("Min: %.4f\n", (float)smin/cmin); -- 1.5.4.3.450.gb92176 |