Gilles Carry wrote:
> Hello,
>
> Of course, if you take Sebastien's patch ("Disable samples and histogram
> files generation by default"), don't take this one.

Ok. I would go with Sebastien's Patch. Thanks.

Regards--
Subrata
>
> Gilles.
>
> Gilles Carry wrote:
>> The default behaviour of matrix_mult is changed.
>> Stats are saved only when requested.
>>
>> Signed-off-by: Gilles Carry <[EMAIL PROTECTED]>
>> Cc: Darren Hart <[EMAIL PROTECTED]>
>> Cc: Tim Chavez <[EMAIL PROTECTED]>
>> ---
>>  testcases/realtime/func/matrix_mult/matrix_mult.c |   45 
>> +++++++++++++--------
>>  1 files changed, 28 insertions(+), 17 deletions(-)
>>
>> diff --git a/testcases/realtime/func/matrix_mult/matrix_mult.c 
>> b/testcases/realtime/func/matrix_mult/matrix_mult.c
>> index 6ea68b6..fa52048 100644
>> --- a/testcases/realtime/func/matrix_mult/matrix_mult.c
>> +++ b/testcases/realtime/func/matrix_mult/matrix_mult.c
>> @@ -55,6 +55,7 @@
>>  static int run_jvmsim = 0;
>>  static int ops_multiplier = DEF_OPS_MULTIPLIER;
>>  static int ops;
>> +static int save_stats = 0;
>>  
>>  void usage(void)
>>  {
>> @@ -62,6 +63,7 @@ void usage(void)
>>      printf("matrix_mult specific options:\n");
>>      printf("  -j            enable jvmsim\n");
>>      printf("  -l#           #: number of multiplications per 
>> iteration per cpu (load)\n");
>> +    printf("  -s            save stats\n");
>>  }
>>  
>>  int parse_args(int c, char *v)
>> @@ -77,6 +79,9 @@ int parse_args(int c, char *v)
>>      case 'h':
>>          usage();
>>          exit(0);
>> +    case 's':
>> +        save_stats = 1;
>> +        break;
>>      default:
>>          handled = 0;
>>          break;
>> @@ -137,7 +142,7 @@ int main(int argc, char *argv[])
>>      int criteria;
>>  
>>      setup();
>> -    rt_init("jl:h", parse_args, argc, argv);
>> +    rt_init("jl:hs", parse_args, argc, argv);
>>      numcpus = sysconf(_SC_NPROCESSORS_ONLN);
>>      criteria = MAX(1, numcpus/2); // the minimum avg concurrent 
>> multiplier to pass
>>      ops = numcpus * ops_multiplier;
>> @@ -159,6 +164,8 @@ int main(int argc, char *argv[])
>>          printf("jvmsim disabled\n");
>>      }
>>  
>> +    printf("Stats %sto be saved\n", save_stats ? "" : "*not* ");
>> +
>>      stats_container_t sdat, cdat;
>>      stats_container_t shist, chist;
>>      if (    stats_container_init(&sdat, ITERATIONS) ||
>> @@ -198,15 +205,17 @@ int main(int argc, char *argv[])
>>      printf("Avg: %.4f us\n", savg);
>>      printf("StdDev: %.4f us\n", stats_stddev(&sdat));
>>  
>> -    if (
>> -        stats_hist(&shist, &sdat) ||
>> +    if (save_stats) {
>> +        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");
>> +            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
>> @@ -246,15 +255,17 @@ int main(int argc, char *argv[])
>>      printf("Avg: %.4f us\n", cavg);
>>      printf("StdDev: %.4f us\n", stats_stddev(&cdat));
>>  
>> -    if (
>> -        stats_hist(&chist, &cdat) ||
>> +    if (save_stats) {
>> +        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");
>> +            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");
>



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to