// histo for compare diff dependence of number of threads #include #include #include // #define USE_VC // const char* inputFile = "make_tbbtime.dat"; // const char* outputFile = "make_tbbtime.root"; const int nFiles = 2; TString inputFile[nFiles]; TString outputFile; TString FileNameTemplate = "make_tbbtime_"; // TString Folder[4] = {"1_event","10_event","100_event","1000_event"}; // TString LegName[4] = {"10^{0} events","10^{1} events","10^{2} events","10^{3} events"}; const int nComp = 1; TString Folder[nComp] = {"."}; const int NCores = 16; // max number of threads set to run TString CompName[nComp]={ // "lxir075"//, // "opladev35", // "opladev32", "lxir039" }; TString LegName[nComp] = { "Intel E7-4860 2.27 GHz"//, // "AMD 6164EH 1.70 GHz", // "Intel L5640 2.27 GHz", // "Intel X5550 2.67 GHz" }; const int MaxSpeed = 1000; // static const int nCPU[nComp] = {2,2,2,2,2,2,2,4,4}; // static const int nCores[nComp] = {24,24,16,24,16,24,16,80,48}; // static const int nCoresPerCPU[nComp] = {12,12,8,12,8,12,8,20,12}; // static const int nCPU[nComp] = {4,4,2,2}; // static const int nCores[nComp] = {80,48,24,16}; // static const int nCoresPerCPU[nComp] = {20,12,12,8}; static const int nCPU[nComp] = {2}; static const int nCores[nComp] = {16}; static const int nCoresPerCPU[nComp] = {8}; void make_timehisto_minbias() { TH1F *hTmp[4]; TH1F *hrAll[nComp]; for(int iComp=0; iComp> iThread; iff >> tmpStr >>tmpStr >>tmpStr >> allCpuTime >>tmpStr>>tmpStr>>tmpStr>>trRealTime; float TrPerus = 1./trRealTime; // std::cout << iThread << " " << TrPerus << std::endl; hr->SetBinContent(iThread+1,1./trRealTime); // tr per sec hr->SetBinError(iThread+1,0.00001); } } // iFile hrAll[iComp] = new TH1F(LegName[iComp].Data(),LegName[iComp].Data(),NCores+1,-0.5,NCores+0.5); // all 1 .. end for(int iBin=0; iBin<=NCores+1; ++iBin) { bool good = 0; for(int iCPU=0; iCPUGetBinContent(iBin) > 0.); if(good) { Int_t N[10]; for(int iCPU=0; iCPU (iCPU+1)*nCoresPerCPU[iComp]) N[iCPU] = nCoresPerCPU[iComp]; else N[iCPU] = iBin - (nCoresPerCPU[iComp] * iCPU+1); } Double_t binCont = 0.; Double_t tMax = 0.; Double_t NTotal = 0.; for(int iCPU=0; iCPUGetBinContent(iBin) > 0.) { NTotal += N[iCPU]; tMax = TMath::Max(tMax,(static_cast(N[iCPU])/hTmp[iCPU]->GetBinContent(iBin))); } } // for(int iCPU=0; iCPUGetBinContent(iBin); binCont = NTotal/tMax; // std::cout << NTotal << " " << iBin << " " << tMax << " " << N[0] << " " << N[1] << " " << nCoresPerCPU[iComp] << std::endl; hrAll[iComp]->SetBinContent(iBin,binCont); hrAll[iComp]->SetBinError(iBin,0.00001); } } } } gStyle->SetCanvasColor(10); gStyle->SetFrameFillColor(10); gStyle->SetTitleColor(0); gStyle->SetHistFillColor(0); gStyle->SetOptStat(00000000); gStyle->SetPadGridX(1); gStyle->SetPadGridY(1); gStyle->SetOptTitle(0); gStyle->SetTextFont(22); TCanvas *c1 = new TCanvas("ITBB", "ITBB", 1200, 800); // TLegend *leg1 = new TLegend(0.17-0.03,.67,0.54-0.03,.89); // leg1->SetFillColor(0); // leg1->SetLineWidth(0); // leg1->SetBorderSize(0); // leg1->SetTextFont(22); // leg1->SetTextSize(0.04); for (int i = 0; i < nComp; i++){ TH1F *hr = hrAll[i]; hr->SetLineColor(0); hr->SetLineWidth(0); // hr->SetMarkerStyle(22); hr->SetMarkerSize(1.7); switch(i){ case 0: hr->SetMarkerStyle(22); break; case 1: hr->SetMarkerStyle(33); hr->SetMarkerSize(2.1);break; case 2: hr->SetMarkerStyle(21); hr->SetMarkerSize(1.2); break; case 3: hr->SetMarkerStyle(23); break; case 4: hr->SetMarkerStyle(23); break; case 5: hr->SetMarkerStyle(22); break; case 6: hr->SetMarkerStyle(23); break; case 7: hr->SetMarkerStyle(21); hr->SetMarkerSize(0.8); break; case 8: hr->SetMarkerStyle(33); hr->SetMarkerSize(1.3); break; case 9: hr->SetMarkerStyle(21); hr->SetMarkerSize(0.8); break; default: hr->SetMarkerStyle(23); } // hr->SetMarkerSize(1.2); switch(i){ case 0: hr->SetMarkerColor(TColor::GetColorDark(kRed)); break; case 1: hr->SetMarkerColor(TColor::GetColorDark(kGreen+1)); break; case 2: hr->SetMarkerColor(TColor::GetColorDark(kBlue)); break; case 3: hr->SetMarkerColor(TColor::GetColorDark(kMagenta)); break; case 4: hr->SetMarkerColor(TColor::GetColorDark(kYellow)); break; case 5: hr->SetMarkerColor(TColor::GetColorDark(kOrange)); break; case 6: hr->SetMarkerColor(TColor::GetColorDark(kMagenta)); break; case 7: hr->SetMarkerColor(TColor::GetColorDark(kTeal)); break; case 8: hr->SetMarkerColor(TColor::GetColorDark(kAzure)); break; case 9: hr->SetMarkerColor(TColor::GetColorDark(kPink)); break; default: hr->SetMarkerColor(TColor::GetColorDark(4+i)); } // hr->SetMarkerStyle(22); // unic // hr->SetMarkerColor(TColor::GetColorDark(2+2)); hr->GetYaxis()->SetTitleFont(22); hr->GetXaxis()->SetTitleFont(22); hr->GetYaxis()->SetLabelFont(22); hr->GetXaxis()->SetLabelFont(22); hr->GetXaxis()->SetTitle("Number of logical cores"); hr->GetYaxis()->SetTitle(Form("Events/s")); hr->GetYaxis()->SetTitleOffset(1.2); hr->GetYaxis()->SetRangeUser(0,MaxSpeed); // tr/us if (i) hr->Draw("same"); else hr->Draw(); // leg1->AddEntry( LegName[i],LegName[i].Data() ); } // leg1->Draw(); // TFile file(outputFile,"RECREATE"); // c1->Write(); TString FileNameSave; FileNameSave = FileNameTemplate; FileNameSave = "scal_minbias_1000_ITBB_gcc_STS_0-8.pdf"; c1->SaveAs(FileNameSave.Data()); }