[Compbench-devel] CompBenchmarks++/libcompbenchmarks/Plan Plan.cpp, 1.18, 1.19 Plan.h, 1.9, 1.10
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2007-08-21 19:49:12
|
Update of /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv460 Modified Files: Plan.cpp Plan.h Log Message: Compiler descriptions added in output directory. Index: Plan.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Plan.h 20 Aug 2007 17:08:22 -0000 1.9 --- Plan.h 21 Aug 2007 19:49:09 -0000 1.10 *************** *** 51,54 **** --- 51,55 ---- int hostCopied; int planCopied; + int compilerCopied; virtual CBM_PB *batchForIteration(int *it_in_plan); *************** *** 62,65 **** --- 63,67 ---- virtual int outputDirectoryCopyHost(void); virtual int outputDirectoryCopyPlan(void); + virtual int outputDirectoryCopyCompilers(void); virtual CBM_PB *addBatch(CBM_PB *_ps); *************** *** 87,91 **** virtual void reset(void); ! virtual int store(std::string _filename = ""); virtual int restore(std::string _filename); --- 89,93 ---- virtual void reset(void); ! virtual int store(std::string _filename = "", int _keepFilename=1); virtual int restore(std::string _filename); Index: Plan.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/libcompbenchmarks/Plan/Plan.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Plan.cpp 20 Aug 2007 17:08:22 -0000 1.18 --- Plan.cpp 21 Aug 2007 19:49:09 -0000 1.19 *************** *** 30,33 **** --- 30,34 ---- planCopied=0; hostCopied=0; + compilerCopied=0; } *************** *** 89,96 **** fn+="host.xml"; ! if (cbmSystem->fileExists(fn)) return(1); ! ! return(cbmSystem->storeHost(fn)); } --- 90,96 ---- fn+="host.xml"; ! if (cbmSystem->fileExists(fn)) return(1); ! return(cbmSystem->storeHost(fn)); } *************** *** 98,101 **** --- 98,102 ---- { std::string fn; + int r; fn=outputDirectory; *************** *** 103,108 **** fn+="plan.xml"; ! return(cbmSystem->storeConfiguration(fn)); } --- 104,158 ---- fn+="plan.xml"; + r=store(fn, 0); + + return(r); + } + + int Plan::outputDirectoryCopyCompilers(void) + { + int i, n = batchNumber(); + int j, m; + PlanBatch *PB; + std::string data = "<compilers>\n"; + Compiler *C; + std::string fn; + + if (compilerCopied) + return(1); + + fn=outputDirectory; + fn+="/"; + fn+="compilers.xml"; + + if (cbmSystem->fileExists(fn)) + return(1); ! for(i=0;i<n;i++) { ! PB=getBatch(i); ! m=PB->compilerNumber(); ! for(j=0; j<m; j++) { ! C=PB->getCompiler(j); ! data+=" <compiler binary=\""; ! data+=C->Binary(); ! data+="\">"; ! ! data+=" <name id=\""; ! data+=C->Name(); ! data+="\"/>\n"; ! ! data+=" <version id=\""; ! data+=C->Version(); ! data+="\" vanilla=\""; ! data+=C->VanillaVersion(); ! data+="\"/>\n"; ! ! data+=" <language id=\""; ! data+=C->Language(); ! data+="\"/>\n"; ! } ! } ! data+="</compilers>\n"; ! ! return(cbmSystem->fileWrite(fn, data)); } *************** *** 269,272 **** --- 319,323 ---- { XMLNode *root = new CBM::XMLNode("libcompbenchmarks-plan"); + XMLNode *outp = new CBM::XMLNode("output-directory"); XMLNode *batchs = new CBM::XMLNode("plan-batchs"); XMLNode *run = new CBM::XMLNode("run"); *************** *** 277,280 **** --- 328,333 ---- int i, n = batchNumber(); + outp->addAttribute("name", outputDirectory); + root->add(outp); root->add(batchs); *************** *** 293,297 **** void Plan::stop(void) { ! int i, n = batchNumber(); for(i=0;i<n;i++) { --- 346,352 ---- void Plan::stop(void) { ! int i, n = batchNumber(); ! std::string rm; ! std::string out; for(i=0;i<n;i++) { *************** *** 299,303 **** --- 354,369 ---- } + if (outputDirectory=="") + return; + + printf("stop %s\n", outputDirectory.c_str()); iteration=0; + + rm="cd "; + rm+=outputDirectory; + rm+=" && "; + rm+=cbmSystem->Program("RM"); + rm+=" -f *.xml && exit 0"; + cbmSystem->exec(rm, out); } *************** *** 311,315 **** } ! int Plan::store(std::string _filename) { int r; --- 377,381 ---- } ! int Plan::store(std::string _filename, int _keepFilename) { int r; *************** *** 318,323 **** delete(root); ! if (_filename!="") ! filename=_filename; // !!! default... --- 384,390 ---- delete(root); ! if (_keepFilename) ! if (_filename!="") ! filename=_filename; // !!! default... *************** *** 337,340 **** --- 404,408 ---- XMLNode *PBs; XMLNode *R; + XMLNode *outp; XMLNode *CI; XMLNode *tmp; *************** *** 354,358 **** planRootNode=r.read(filename); - reset(); if (!planRootNode) { --- 422,425 ---- *************** *** 360,364 **** return(0); } - if (planRootNode->Name()!="libcompbenchmarks-plan") { cbmUI->outputKO("Invalid plan file : root object is not libcompbenchmarks-plan"); --- 427,430 ---- *************** *** 379,384 **** pb->restore(tmp); planBatch.push_back(pb); ! } ! } --- 445,449 ---- pb->restore(tmp); planBatch.push_back(pb); ! } } *************** *** 388,391 **** --- 453,467 ---- return(0); } + outp=planRootNode->getNode("output-directory"); + if (!outp) { + cbmUI->outputKO("Can't retrieve output directory"); + return(0); + } + A=outp->getAttribute("name"); + if (!A) { + cbmUI->outputKO("Can't get name of output directory"); + return(0); + } + setOutputDirectory(A->Value()); CI=R->getNode("iteration"); *************** *** 403,407 **** iteration=atoi(A->Value().c_str()); - pb=batchForIteration(&bi); --- 479,482 ---- |