Improve runner reporting

This commit is contained in:
Rodrigo Arias 2023-06-23 18:06:03 +02:00
parent 565ca20050
commit 6517bdda91

View File

@ -9,11 +9,7 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <unistd.h> #include <unistd.h>
//static void static char *progname = "b6_runner";
//usage(void)
//{
// exit(1);
//}
struct sampling { struct sampling {
int nmax; int nmax;
@ -47,7 +43,6 @@ do_run(char *argv[], double *ptime)
*nl = '\0'; *nl = '\0';
/* Clean status line */ /* Clean status line */
fprintf(stderr, " \r");
fprintf(stderr, "%s\n", line); fprintf(stderr, "%s\n", line);
double time; double time;
@ -111,8 +106,8 @@ stats(struct sampling *s)
double se = stdev / sqrt(n); double se = stdev / sqrt(n);
double rse = 100.0 * se * 1.96 / mean; double rse = 100.0 * se * 1.96 / mean;
fprintf(stderr, "n=%03d median=%.3e mean=%.3e SD=%.3e RSD=%.2f%% RSE=%.2f%% \r", fprintf(stderr, "%s: n=%03d median=%.3e mean=%.3e SD=%.3e RSD=%.2f%% RSE=%.2f%%\n",
s->n, median, mean, stdev, rstdev, rse); progname, s->n, median, mean, stdev, rstdev, rse);
s->rse = rse; s->rse = rse;
} }
@ -143,20 +138,6 @@ add_sample(struct sampling *s, double time)
} }
} }
//static int
//compare_double(const void *a, const void *b)
//{
// double aa = *(const double *) a;
// double bb = *(const double *) b;
//
// if (aa < bb)
// return -1;
// else if (aa > bb)
// return +1;
// else
// return 0;
//}
static int static int
sample(char *argv[]) sample(char *argv[])
{ {
@ -186,6 +167,7 @@ sample(char *argv[])
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
progname_set(progname);
(void) argc; (void) argc;
if (sample(argv+1) != 0) { if (sample(argv+1) != 0) {