void report_verbose(const bench_problem *p, double *t, int st) { struct stats s; char bmin[64], bmax[64], bavg[64], bmedian[64], btmin[64]; char bsetup[64]; int copyp = tensor_sz(p->sz) == 1; mkstat(t, st, &s); sprintf_time(s.min, bmin, 64); sprintf_time(s.max, bmax, 64); sprintf_time(s.avg, bavg, 64); sprintf_time(s.median, bmedian, 64); sprintf_time(time_min, btmin, 64); sprintf_time(p->setup_time, bsetup, 64); ovtpvt("Problem: %s, setup: %s, time: %s, %s: %.5g\n", p->pstring, bsetup, bmin, copyp ? "fp-move/us" : "``mflops''", mflops(p, s.min)); if (verbose) { ovtpvt("Took %d measurements for at least %s each.\n", st, btmin); ovtpvt("Time: min %s, max %s, avg %s, median %s\n", bmin, bmax, bavg, bmedian); } }
void report_time(const bench_problem *p, double *t, int st) { struct stats s; UNUSED(p); mkstat(t, st, &s); ovtpvt("(%g %g %g %g)\n", s.min, s.avg, s.max, s.median); }
void report_mflops(const bench_problem *p, double *t, int st) { struct stats s; mkstat(t, st, &s); ovtpvt("(%g %g %g %g)\n", mflops(p, s.max), mflops(p, s.avg), mflops(p, s.min), mflops(p, s.median)); }
Stat* mkemptystate(Vtime *synctime) { Stat *s; s = mkstat(); s->state = SNonexistent; s->synctime = copyvtime(synctime); return s; }
int main(int argc, char *argv[] ) { struct connection *head, *top; //start of list of cons char ch; int opt_idx = 0; static struct option long_opt[] = { {"month", 0, 0, 'm'}, {"user", 0, 0, 'u'}, {"isp", 0, 0, 'i'}, {"human", 0, 0, 'h'}, {"debug", 0, 0, 'd'}, {"help", 0, 0, 'H'}, {"version", 0, 0, 'v'}, {0, 0, 0, 0} }; setlocale(LC_ALL, ""); setlocale(LC_NUMERIC, "C"); bindtextdomain(PACKAGE,LOCALEDIR); textdomain(PACKAGE); //getting command line if ( argc > 1 ) { while ( (ch = getopt_long(argc, argv, "muihdv", long_opt, &opt_idx)) != -1 ) switch ( ch ) { case 'm': fl.mounth = 1; break; case 'u': fl.user = 1; break; case 'i': fl.isp = 1; break; case 'h': fl.human = 1; break; case 'd': fl.debug = 1; break; case 'H': usage(); break; case 'v': version(); break; default: fprintf(stderr, _("Bad option %c\n"), ch); usage(); } } else usage(); //extracting logs from archives extract_logs(); //lets roll!! head = parse_logs(); if ( fl.debug ) { show_isp( get_isp() ); printf(_("\nSTAGE 1 - collected all connections:\n")); show_cons(head); } norm_cons(head); if ( fl.debug ) { printf(_("\nSTAGE 2 - normalize connections:\n")); show_cons(head); } top = mkstat(head, &fl); if ( fl.debug ) { printf(_("\nSTAGE 3 - counted specified stats (user=%d, isp=%d)per day:\n"), fl.user, fl.isp); show_cons(top); fprintf(stderr, _("STAGE 3 finished!\n")); } show_stat(head, &fl); exit(0); }
void report_benchmark(const bench_problem *p, double *t, int st) { struct stats s; mkstat(t, st, &s); ovtpvt("%.5g %.8g %g\n", mflops(p, s.min), s.min, p->setup_time); }