[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Plan Plan-Batch.cpp, 1.13, 1.14 Plan.cpp, 1.19
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-09-10 19:43:21
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24130 Modified Files: Plan-Batch.cpp Plan.cpp Plan.h Log Message: Run number (number of times each benchmark'll get evaluated) has been introduced. Index: Plan.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Plan.h 6 Sep 2007 16:51:40 -0000 1.11 --- Plan.h 10 Sep 2007 19:43:18 -0000 1.12 *************** *** 74,77 **** --- 74,81 ---- int compilerCopied; + /** Number of evaluations per benchmarks. + * Number of time a benchmark'll be evaluated using same compiler and options */ + int runNumber; + /** Get batch and its interal iteration index. * *************** *** 96,99 **** --- 100,111 ---- virtual int setOutputDirectory(std::string _outputDirectory); + /** Return number of times each benchmark'll be evaluated. + * \sa runNumber */ + virtual int getRunNumber(void); + + /** Set number of times each benchmark'll be evaluated. + * \sa runNumber */ + virtual void setRunNumber(int _runNumber); + /** Get output directory. * Index: Plan.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Plan.cpp 21 Aug 2007 19:49:09 -0000 1.19 --- Plan.cpp 10 Sep 2007 19:43:18 -0000 1.20 *************** *** 31,34 **** --- 31,35 ---- hostCopied=0; compilerCopied=0; + runNumber=1; } *************** *** 45,48 **** --- 46,59 ---- } + int Plan::getRunNumber(void) + { + return(runNumber); + } + + void Plan::setRunNumber(int _runNumber) + { + runNumber=_runNumber; + } + std::string Plan::getOutputDirectory(void) { *************** *** 329,332 **** --- 340,346 ---- outp->addAttribute("name", outputDirectory); + sprintf(c, "%d", getRunNumber()); + root->addAttribute("runNumber", c); + root->add(outp); root->add(batchs); *************** *** 432,435 **** --- 446,456 ---- } + A=planRootNode->getAttribute("runNumber"); + if (!A) { + cbmUI->outputKO("runNumber attribute not found on libcompbenchmarks-plan"); + return(0); + } + runNumber=atoi(A->Value().c_str()); + PBs=planRootNode->getNode("plan-batchs"); if (!PBs) { Index: Plan-Batch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan-Batch.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Plan-Batch.cpp 4 Sep 2007 16:38:14 -0000 1.13 --- Plan-Batch.cpp 10 Sep 2007 19:43:18 -0000 1.14 *************** *** 249,252 **** --- 249,253 ---- std::string _id) { + return(_set->add(_id)); } *************** *** 455,459 **** int PlanBatch::totalIterations(void) { ! return(compilerNumber()*compilerOptionsTotalNumber()*benchmarkNumber()); } --- 456,460 ---- int PlanBatch::totalIterations(void) { ! return(compilerNumber()*compilerOptionsTotalNumber()*benchmarkNumber()*plan->getRunNumber()); } *************** *** 470,474 **** CBM::Compiler *PlanBatch::currentCompiler(void) { ! int compilerIndex = (iteration/(compilerOptionSetNumber()*benchmarkNumber()))%compilerNumber(); CBM::Compiler *C = getCompiler(compilerIndex); --- 471,475 ---- CBM::Compiler *PlanBatch::currentCompiler(void) { ! int compilerIndex = (iteration/(compilerOptionSetNumber()*benchmarkNumber()*plan->getRunNumber()))%compilerNumber(); CBM::Compiler *C = getCompiler(compilerIndex); *************** *** 478,482 **** CBM::CompilerOptions *PlanBatch::currentCompilerOptions(void) { ! int rawIndex = (iteration/(benchmarkNumber()*compilerNumber()))%compilerOptionsTotalNumber(); int i, n = compilerOptionSetNumber(); CBM::CompilerOptionSet *OS; --- 479,483 ---- CBM::CompilerOptions *PlanBatch::currentCompilerOptions(void) { ! int rawIndex = (iteration/(benchmarkNumber()*compilerNumber()*plan->getRunNumber()))%compilerOptionsTotalNumber(); int i, n = compilerOptionSetNumber(); CBM::CompilerOptionSet *OS; *************** *** 496,500 **** CBM::Benchmark *PlanBatch::currentBenchmark(void) { ! int benchmarkIndex = iteration%benchmarkNumber(); CBM::Benchmark *B = getBenchmark(benchmarkIndex); --- 497,501 ---- CBM::Benchmark *PlanBatch::currentBenchmark(void) { ! int benchmarkIndex = (iteration*plan->getRunNumber())%benchmarkNumber(); CBM::Benchmark *B = getBenchmark(benchmarkIndex); |