Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / contrib / benchmarking_code_block / bench.h
index fc86bc3..97c76b4 100644 (file)
@@ -1,3 +1,9 @@
+/* Copyright (c) 2013-2023. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 /* Copy to src/include/xbt/ folder  */
 
 /* Benchmarking a code block */
@@ -55,7 +61,6 @@ static inline void xbt_bench_init(char *tracefile)
        mybench->output = fopen(tracefile, "a+");
        if (mybench->output == NULL)
                printf("Error while opening the tracefile");
-
 }
 
 /* Initializing StarPU benchmarking */
@@ -66,7 +71,6 @@ static inline void bench_init_starpu(char *tracefile, bench_t *bench)
   mybench->output = fopen(tracefile, "a+");
   if (mybench->output == NULL)
                printf("Error while opening the tracefile");
-
 }
 
 /* Start benchmarking using macros */
@@ -91,7 +95,7 @@ static inline int bench_end_block(char* block_id)
                clock_gettime(CLOCK_REALTIME, &mybench->end_time);
                struct timespec interval;
                xbt_diff_time(&mybench->start_time, &mybench->end_time, &interval);
-               fprintf(mybench->output, "%s %lf %lf %lf\n", block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
+               fprintf(mybench->output, "%s %f %f %f\n", block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
                return 0;
        }
 }
@@ -127,7 +131,7 @@ static inline int xbt_bench_end(char* block_id)
        if(mybench->block_id == NULL)
                strcat (mybench->block_id, "NONAME");
 
-       fprintf(mybench->output, "%s %lf %lf %lf\n", mybench->block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
+       fprintf(mybench->output, "%s %f %f %f\n", mybench->block_id, xbt_get_time(&mybench->start_time), xbt_get_time(&mybench->end_time), xbt_get_time(&interval));
        return 0;
 }