void PIOS::print_stats(run_arg *args) { char regionstr[32], chunkstr[32], mbstr[32]; cfs_duration_t highest, lowest, average; __u64 agvsize; Stat *st = args->st; assert(st != NULL); st->Record("%d\t%s\t%llu\t%d\t%llu\t%s\t%s\t", args->runno, args->verify ? "Read" : "Write", args->startime, args->threadcount, args->regioncount, in_MBs(regionstr, args->regionsize), in_MBs(chunkstr, args->chunksize)); /* TODO: chunk noise */ assert(args->chunknoise == 0); agvsize = args->regionsize * args->regioncount; find_high_low_duration(args, &highest, &lowest, &average); in_MBs(mbstr, agvsize * params.TimeUnit / args->iotime); st->Record("%s/s\t\t%2.3fs\t%2.3fs\t%2.3fs\n", mbstr, ((double)(lowest / 1000000)) / 1000.0, ((double)(highest / 1000000)) / 1000.0, ((double)(args->iotime / 1000000)) / 1000.0); }
void PIOS::Run() { struct pios_params params; struct run_arg args; int runno = 0; Stat *st; __u32 T; __u64 C; __u64 O; __u64 S; __u64 N; memset(¶ms, 0, sizeof(params)); params.factor = 2; params.fpp = 1; params.C[0] = /*8 * 1048576; //*/512 * 1024; params.C[1] = /*8 * 1048576; //*/512 * 1024; params.O[0] = 8 * 1048576; params.O[1] = 8 * 1048576; params.S[0] = 8 * 1048576; params.S[1] = 8 * 1048576; params.N[0] = 1; params.N[1] = 128; params.T[0] = 1; params.T[1] = 16; st = new Stat(/*"pios.res"*/stdout); st->Record("Run\tTest\tTstamp\t\tT\tN\tS\tC\t%s" "Aggregate\tLowest\tHighest\tRun_time\n", params.cpuload ? "CPUload\t" : ""); st->Record("-------------------------------------------------------" "----------------------------------------------------\n"); for (T = params.T[0]; T <= params.T[1]; T *= params.factor) { for (C = params.C[0]; C <= params.C[1]; C *= params.factor) { for (S = params.S[0]; S <= params.S[1]; S *= params.factor) { if (S < C) printf("Error: chunksize (%llu) can not be" "smaller than regionsize (%llu)\n", S, C); for (N = params.N[0]; N <= params.N[1]; N *= params.factor) { for (O = params.O[0]; O <= params.O[1]; O *= params.factor) { BUG_ON(O < S || O < C); memset(&args, 0, sizeof(args)); args.runno = runno; args.threadcount = T; args.regioncount = N; args.chunksize = C; args.regionsize = S; args.offset = O; args.st = st; args.fpp = params.fpp; OneRun(&args); runno++; } } } } } st->Record("------------------------------------------------------" "---------------------------------------------------\n"); delete st; }