int main(int argc, char **argv, char **envp) { if (argc<2) { fprintf(stderr,"Usage:\n\t%s <router.conf>\n", argv[0]); exit(0); } Report::openFile("netBench.log"); SescConf = new SConfig(argv[1]); // First thing to do net = new InterConnection("network1"); nRouters = net->getnRouters(); for(size_t i=0 ; i<nRouters ; i++ ) { ProtocolA *p = new ProtocolA(net, i); pa.push_back(p); } printf("System ready\n"); fprintf(stderr,"Bench two neighbours message..."); startBench(); bench1(); fprintf(stderr,"done\n"); endBench("bench1"); fprintf(stderr,"Bench heavy traffic..."); startBench(); bench2(); fprintf(stderr,"done\n"); endBench("bench2"); fprintf(stderr,"Mix Benchmark..."); startBench(); bench2(); printf("one\n"); bench2(); printf("two\n"); bench1(); printf("three\n"); bench2(); fprintf(stderr,"done\n"); endBench("bench3"); for(int k = 0; k < TIME_BUBBLE*100 ; k++) { EventScheduler::advanceClock(); } GStats::report("netBench stats"); Report::close(); }
int main(int argc, char *argv[]) { bench2(0 , 0x7fffff, 127-4, 127+13 ); return 0; }