[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Plan Plan-Batch.cpp, 1.5, 1.6 Plan-Batch.h, 1.
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-07-31 17:24:10
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28223 Modified Files: Plan-Batch.cpp Plan-Batch.h Log Message: Changes implied by modification on underlaying APIs. Index: Plan-Batch.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan-Batch.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Plan-Batch.h 13 Jun 2007 18:40:43 -0000 1.3 --- Plan-Batch.h 31 Jul 2007 17:24:03 -0000 1.4 *************** *** 19,32 **** --- 19,36 ---- #include <Benchmark/Benchmark.h> #include <Compiler/Compiler-OptionSet.h> + #include <Plan/Plan.h> %} #include <Benchmark/Benchmark.h> #include <Compiler/Compiler-OptionSet.h> + #include <Plan/Plan.h> #define CBM_BM CBM::Benchmark #define CBM_OS CBM::CompilerOptionSet #define CBM_OP CBM::CompilerOptions + #define CBM_PLAN CBM::Plan #else # define CBM_BM class Benchmark # define CBM_OS class CompilerOptionSet # define CBM_OP class CompilerOptions + # define CBM_PLAN class Plan #endif *************** *** 40,47 **** private: std::string id; protected: ! std::vector<class Compiler *> compilers; /*!< Compilers */ ! std::vector<CBM_OS*> compilerOptions; /*!< Compiler optimisations' sets */ ! std::vector<class Benchmark *> benchmarks; /*!< Benchmarks */ /** Current iteration. --- 44,53 ---- private: std::string id; + CBM_PLAN *plan; + protected: ! std::vector<class Compiler *> compilers; /*!< Compilers */ ! std::vector<CBM_OS*> compilerOptionSets; /*!< Compiler optimisations' sets */ ! std::vector<class Benchmark *> benchmarks; /*!< Benchmarks */ /** Current iteration. *************** *** 65,69 **** public: ! PlanBatch(std::string _id); virtual std::string Id(void); --- 71,76 ---- public: ! PlanBatch(CBM::Plan *_plan, ! std::string _id); virtual std::string Id(void); *************** *** 85,94 **** virtual int compilerNumber(void); ! virtual int compilerOptionNumber(void); virtual int benchmarkNumber(void); virtual class Compiler* getCompiler(int _index); ! virtual CBM_OS *getCompilerOptions(int _index); ! virtual CBM_OS *getCompilerOptions(std::string id); virtual CBM_BM *getBenchmark(int _index); --- 92,104 ---- virtual int compilerNumber(void); ! virtual int compilerOptionSetNumber(void); ! ! virtual int compilerOptionsTotalNumber(void); ! virtual int benchmarkNumber(void); virtual class Compiler* getCompiler(int _index); ! virtual CBM_OS *getCompilerOptionSet(int _index); ! virtual CBM_OS *getCompilerOptionSet(std::string id); virtual CBM_BM *getBenchmark(int _index); *************** *** 104,113 **** virtual int nextIteration(int simule = 0); ! virtual void stop(void); class XMLNode *XML(void); virtual void reset(void); - virtual int store(void); virtual int restore(XMLNode *_planRootNode); --- 114,122 ---- virtual int nextIteration(int simule = 0); ! virtual void stop(int _broadcast); class XMLNode *XML(void); virtual void reset(void); virtual int restore(XMLNode *_planRootNode); Index: Plan-Batch.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan-Batch.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Plan-Batch.cpp 13 Jun 2007 18:40:43 -0000 1.5 --- Plan-Batch.cpp 31 Jul 2007 17:24:02 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- ------------------------------------------------------------------------- */ #include <Plan/Plan-Batch.h> + #include <Plan/Plan.h> #include <Compiler/Compiler.h> #include <Compiler/Compiler-Options.h> *************** *** 21,28 **** using namespace CBM; ! PlanBatch::PlanBatch(std::string _id) { iteration=0; id=_id; } --- 22,31 ---- using namespace CBM; ! PlanBatch::PlanBatch(CBM::Plan *_plan, ! std::string _id) { iteration=0; id=_id; + plan=_plan; } *************** *** 99,107 **** { int i; ! int n = compilerOptionNumber(); CBM::CompilerOptionSet *O; for(i=0; i<n; i++) { ! O=getCompilerOptions(i); if (O->Id() == _set->Id()) return(0); --- 102,110 ---- { int i; ! int n = compilerOptionSetNumber(); CBM::CompilerOptionSet *O; for(i=0; i<n; i++) { ! O=getCompilerOptionSet(i); if (O->Id() == _set->Id()) return(0); *************** *** 213,217 **** compilers.push_back(_compiler); ! stop(); cbmUI->outputOK(); --- 216,220 ---- compilers.push_back(_compiler); ! stop(1); cbmUI->outputOK(); *************** *** 235,240 **** } ! compilerOptions.push_back(_set); ! stop(); cbmUI->outputOK(); --- 238,243 ---- } ! compilerOptionSets.push_back(_set); ! stop(1); cbmUI->outputOK(); *************** *** 277,281 **** benchmarks.push_back(_benchmark); ! stop(); cbmUI->outputOK(); return(1); --- 280,284 ---- benchmarks.push_back(_benchmark); ! stop(1); cbmUI->outputOK(); return(1); *************** *** 305,309 **** if (found) { compilers=ncompilers; ! stop(); cbmUI->outputOK(); } else { --- 308,312 ---- if (found) { compilers=ncompilers; ! stop(1); cbmUI->outputOK(); } else { *************** *** 317,321 **** { int i; ! int n = compilerOptionNumber(); CBM::CompilerOptionSet *OS = 0; std::vector<CBM::CompilerOptionSet*> noptions; --- 320,324 ---- { int i; ! int n = compilerOptionSetNumber(); CBM::CompilerOptionSet *OS = 0; std::vector<CBM::CompilerOptionSet*> noptions; *************** *** 324,328 **** cbmUI->msgPlanOptionsetUnregister(_set->Id()); for(i=0; i<n; i++) { ! OS=getCompilerOptions(i); if (OS->Id()!=_set->Id()) noptions.push_back(OS); --- 327,331 ---- cbmUI->msgPlanOptionsetUnregister(_set->Id()); for(i=0; i<n; i++) { ! OS=getCompilerOptionSet(i); if (OS->Id()!=_set->Id()) noptions.push_back(OS); *************** *** 335,340 **** if (found) { ! compilerOptions=noptions; ! stop(); cbmUI->outputOK(); } else { --- 338,343 ---- if (found) { ! compilerOptionSets=noptions; ! stop(1); cbmUI->outputOK(); } else { *************** *** 348,352 **** CBM::CompilerOptions *_opt) { ! stop(); return(_set->remove(_opt)); } --- 351,355 ---- CBM::CompilerOptions *_opt) { ! stop(1); return(_set->remove(_opt)); } *************** *** 371,375 **** if (found) { ! stop(); benchmarks=nbenchmarks; cbmUI->outputOK(); --- 374,378 ---- if (found) { ! stop(1); benchmarks=nbenchmarks; cbmUI->outputOK(); *************** *** 388,394 **** } ! int PlanBatch::compilerOptionNumber(void) { ! return(compilerOptions.size()); } --- 391,411 ---- } ! int PlanBatch::compilerOptionSetNumber(void) { ! return(compilerOptionSets.size()); ! } ! ! int PlanBatch::compilerOptionsTotalNumber(void) ! { ! int i, n = compilerOptionSetNumber(); ! CBM::CompilerOptionSet *OS; ! int r = 0; ! ! for(i=0; i<n; i++) { ! OS=getCompilerOptionSet(i); ! r+=OS->optionNumber(); ! } ! ! return(r); } *************** *** 406,424 **** } ! CBM::CompilerOptionSet *PlanBatch::getCompilerOptions(int _index) { ! if (_index<compilerOptionNumber()) ! return(compilerOptions[_index]); else return(0); } ! CBM::CompilerOptionSet *PlanBatch::getCompilerOptions(std::string id) { CBM::CompilerOptionSet *c = 0; ! int i, n = compilerOptionNumber(); for(i=0;i<n;i++) { ! c=getCompilerOptions(i); if (c->Id()==id) return(c); --- 423,441 ---- } ! CBM::CompilerOptionSet *PlanBatch::getCompilerOptionSet(int _index) { ! if (_index<compilerOptionSetNumber()) ! return(compilerOptionSets[_index]); else return(0); } ! CBM::CompilerOptionSet *PlanBatch::getCompilerOptionSet(std::string id) { CBM::CompilerOptionSet *c = 0; ! int i, n = compilerOptionSetNumber(); for(i=0;i<n;i++) { ! c=getCompilerOptionSet(i); if (c->Id()==id) return(c); *************** *** 437,441 **** int PlanBatch::totalIterations(void) { ! return(compilerNumber()*compilerOptionNumber()*benchmarkNumber()); } --- 454,458 ---- int PlanBatch::totalIterations(void) { ! return(compilerNumber()*compilerOptionsTotalNumber()*benchmarkNumber()); } *************** *** 447,451 **** CBM::Compiler *PlanBatch::currentCompiler(void) { ! int compilerIndex = (iteration/(compilerOptionNumber()*benchmarkNumber()))%compilerNumber(); CBM::Compiler *C = getCompiler(compilerIndex); --- 464,468 ---- CBM::Compiler *PlanBatch::currentCompiler(void) { ! int compilerIndex = (iteration/(compilerOptionSetNumber()*benchmarkNumber()))%compilerNumber(); CBM::Compiler *C = getCompiler(compilerIndex); *************** *** 455,463 **** CBM::CompilerOptions *PlanBatch::currentCompilerOptions(void) { ! int optionIndex = (iteration/benchmarkNumber())%compilerOptionNumber(); ! ! // std::string O = getCompilerOptions(optionIndex); ! // return(O); } --- 472,489 ---- CBM::CompilerOptions *PlanBatch::currentCompilerOptions(void) { ! int rawIndex = (iteration/(benchmarkNumber()*compilerNumber()))%compilerOptionsTotalNumber(); ! int i, n = compilerOptionSetNumber(); ! CBM::CompilerOptionSet *OS; ! int on; ! for(i=0; i<n; i++) { ! OS=getCompilerOptionSet(i); ! on=OS->optionNumber(); ! if (rawIndex<=on) { ! return(OS->Options(rawIndex)); ! } else ! rawIndex-=on; ! } ! return(0); } *************** *** 562,568 **** } ! n=compilerOptionNumber(); for(i=0; i<n; i++) { ! tmp=getCompilerOptions(i)->XML(); OS->add(tmp); } --- 588,594 ---- } ! n=compilerOptionSetNumber(); for(i=0; i<n; i++) { ! tmp=getCompilerOptionSet(i)->XML(); OS->add(tmp); } *************** *** 571,579 **** } ! void PlanBatch::stop(void) { if (iteration) cbmUI->outputInfo("Context changed : current plan benchmarking will be restarted."); iteration=0; } --- 597,607 ---- } ! void PlanBatch::stop(int _broadcast) { if (iteration) cbmUI->outputInfo("Context changed : current plan benchmarking will be restarted."); iteration=0; + if (_broadcast) + plan->stop(); } *************** *** 592,610 **** } ! while ( (O=getCompilerOptions(0)) != 0) { remove(O); } } - int PlanBatch::store(void) - { - /* - XMLNode *root = XML(); - - cbmSystem->Config()->setPlan(root); - return(cbmSystem->storeConfiguration()); - */ - } - int PlanBatch::restore(XMLNode *_planRootNode) { --- 620,628 ---- } ! while ( (O=getCompilerOptionSet(0)) != 0) { remove(O); } } int PlanBatch::restore(XMLNode *_planRootNode) { *************** *** 614,618 **** XMLNode *OP; XMLNode *CO; - XMLNode *CI; XMLAttribute *A; --- 632,635 ---- |