Skip to content

Commit

Permalink
Merge pull request cms-sw#140 from dan131riley/phi3-benchmarks
Browse files Browse the repository at this point in the history
Phi3 benchmarks
  • Loading branch information
osschar authored May 11, 2018
2 parents ddcfafe + 3eaac1f commit e518d34
Show file tree
Hide file tree
Showing 44 changed files with 204 additions and 207 deletions.
2 changes: 1 addition & 1 deletion Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ OPT := -g -O3
# 4. Vectorization settings
ifdef AVX_512
VEC_GCC := -mavx512f -mavx512cd # -march=native -fopt-info-vec -mavx
VEC_ICC := -xCOMMON-AVX512 #-march=native -mtune=native #-xcore-avx512 -qopt-zmm-usage=high
VEC_ICC := -xHost -qopt-zmm-usage=high #-march=native -mtune=native #-xcore-avx512
else
VEC_GCC := -msse3 # -mavx # -fopt-info-vec-all
VEC_ICC := -mavx
Expand Down
2 changes: 1 addition & 1 deletion mkFit/ConformalUtilsMPlex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void conformalFitMPlex(bool fitting, MPlexQI seedID, MPlexLS& outErr, MPlexLV& o
}

MPlexHH A;
#pragma omp simd
//#pragma omp simd // triggers an internal compiler error with icc 18.0.2!
for (int n = 0; n < N; ++n)
{
for (int i = 0; i < 3; ++i)
Expand Down
2 changes: 1 addition & 1 deletion mkFit/MkFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void MkFinder::SelectHitIndices(const LayerOfHits &layer_of_hits,
}

dphi = std::min(std::abs(dphi), L.max_dphi());
dq = std::min(std::max(dq, L.min_dq()), L.max_dq());
dq = clamp(dq, L.min_dq(), L.max_dq());

qv[itrack] = q;
phiv[itrack] = phi;
Expand Down
2 changes: 1 addition & 1 deletion plotting/Common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace
arch_opt.vumax = 16;

arch_opt.thmin = 1;
arch_opt.thmax = 48;
arch_opt.thmax = 64;

arch_opt.vutimemin = 0.;
arch_opt.vutimemax = 2.;
Expand Down
2 changes: 1 addition & 1 deletion plotting/PlotBenchmarks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "plotting/PlotBenchmarks.hh"
#include "PlotBenchmarks.hh"

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion plotting/PlotBenchmarks.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _PlotBenchmarks_
#define _PlotBenchmarks_

#include "plotting/Common.hh"
#include "Common.hh"

typedef std::vector<TGraphErrors*> TGEVec;

Expand Down
32 changes: 19 additions & 13 deletions plotting/PlotMEIFBenchmarks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "plotting/PlotMEIFBenchmarks.hh"
#include "PlotMEIFBenchmarks.hh"

PlotMEIFBenchmarks::PlotMEIFBenchmarks(const TString & arch, const TString & sample, const TString & build)
: arch(arch), sample(sample), build(build)
Expand Down Expand Up @@ -75,21 +75,25 @@ void PlotMEIFBenchmarks::MakeOverlay(const TString & text, const TString & title
{
const TString nEV = Form("%i",events[i].nev);
graphs[i] = (TGraph*)file->Get("g_"+build+"_MEIF_nEV"+nEV+"_"+text);
graphs[i]->SetTitle(title+";"+xtitle+";"+ytitle);

graphs[i]->SetLineWidth(2);
graphs[i]->SetLineColor(events[i].color);
graphs[i]->SetMarkerStyle(kFullCircle);
graphs[i]->SetMarkerColor(events[i].color);
if (graphs[i]) {
graphs[i]->SetTitle(title+";"+xtitle+";"+ytitle);

graphs[i]->SetLineWidth(2);
graphs[i]->SetLineColor(events[i].color);
graphs[i]->SetMarkerStyle(kFullCircle);
graphs[i]->SetMarkerColor(events[i].color);
}
}

// Draw graphs
for (UInt_t i = 0; i < events.size(); i++)
{
graphs[i]->Draw(i>0?"LP SAME":"ALP");
graphs[i]->GetXaxis()->SetRangeUser(xmin,xmax);
graphs[i]->GetYaxis()->SetRangeUser(ymin,ymax);
leg->AddEntry(graphs[i],Form("%i Events",events[i].nev),"LP");
if (graphs[i]) {
graphs[i]->Draw(i>0?"LP SAME":"ALP");
graphs[i]->GetXaxis()->SetRangeUser(xmin,xmax);
graphs[i]->GetYaxis()->SetRangeUser(ymin,ymax);
leg->AddEntry(graphs[i],Form("%i Events",events[i].nev),"LP");
}
}

// Draw ideal scaling line
Expand All @@ -115,8 +119,10 @@ void PlotMEIFBenchmarks::MakeOverlay(const TString & text, const TString & title
canv->SetLogx();
for (UInt_t i = 0; i < events.size(); i++)
{
graphs[i]->GetXaxis()->SetRangeUser(xmin,xmax);
graphs[i]->GetYaxis()->SetRangeUser(ymin,ymax);
if (graphs[i]) {
graphs[i]->GetXaxis()->SetRangeUser(xmin,xmax);
graphs[i]->GetYaxis()->SetRangeUser(ymin,ymax);
}
}
canv->Update();
canv->SaveAs(outname+"_logx.png");
Expand Down
7 changes: 5 additions & 2 deletions plotting/PlotMEIFBenchmarks.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _PlotMEIFBenchmarks_
#define _PlotMEIFBenchmarks_

#include "plotting/Common.hh"
#include "Common.hh"

#include "TGraph.h"

Expand All @@ -23,10 +23,13 @@ namespace
events.push_back({8,kRed});
events.push_back({(ARCH==SNB?12:16),kMagenta});

if (ARCH == KNL)
if (ARCH == KNL || ARCH == SKL)
{
events.push_back({32,kAzure+10});
events.push_back({64,kOrange+3});
}
if (ARCH == KNL)
{
events.push_back({128,kViolet-1});
}
}
Expand Down
2 changes: 1 addition & 1 deletion plotting/PlotValidation.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "plotting/PlotValidation.hh"
#include "PlotValidation.hh"

PlotValidation::PlotValidation(const TString & inName, const TString & outName, const Bool_t cmsswComp,
const Bool_t mvInput, const Bool_t saveAs, const TString & outType)
Expand Down
2 changes: 1 addition & 1 deletion plotting/PlotsFromDump.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "plotting/PlotsFromDump.hh"
#include "PlotsFromDump.hh"

PlotsFromDump::PlotsFromDump(const TString & sample, const TString & build) : sample(sample), build(build)
{
Expand Down
6 changes: 3 additions & 3 deletions plotting/PlotsFromDump.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _PlotsFromDump_
#define _PlotsFromDump_

#include "plotting/Common.hh"
#include "Common.hh"

struct TestOpts
{
Expand All @@ -21,8 +21,8 @@ namespace
tests.push_back({"SNB","NVU8int_NTH24",kBlack,kOpenCross});
tests.push_back({"KNL","NVU1_NTH1",kGreen+1,kOpenTriangleUp});
tests.push_back({"KNL","NVU16int_NTH256",kOrange+1,kOpenTriangleDown});
//tests.push_back({"SKL","NVU1_NTH1",kRed+1,kOpenTriangleUp});
//tests.push_back({"SKL","NVU16int_NTH48",kMagenta+1,kOpenTriangleDown});
tests.push_back({"SKL-SP","NVU1_NTH1",kRed+1,kOpenTriangleUp});
tests.push_back({"SKL-SP","NVU16int_NTH64",kMagenta+1,kOpenTriangleDown});
}
};

Expand Down
2 changes: 1 addition & 1 deletion plotting/StackValidation.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "plotting/StackValidation.hh"
#include "StackValidation.hh"

StackValidation::StackValidation(const TString & label, const TString & extra, const Bool_t cmsswComp) : label(label), extra(extra), cmsswComp(cmsswComp)
{
Expand Down
2 changes: 1 addition & 1 deletion plotting/StackValidation.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef _StackValidation_
#define _StackValidation_

#include "plotting/Common.hh"
#include "Common.hh"

#include "TEfficiency.h"
#include "TGraphAsymmErrors.h"
Expand Down
4 changes: 2 additions & 2 deletions plotting/benchmarkPlots.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /bin/bash

## In case this is run separately from the main script
[ -z "$ROOTSYS" ] && source ~matevz/root/bin/thisroot.sh
[ -z "$ROOTSYS" ] && source /cvmfs/cms.cern.ch/slc7_amd64_gcc630/lcg/root/6.12.07-gnimlf/etc/profile.d/init.sh
source xeon_scripts/common_variables.sh

##### Make benchmark plots for each architecture #####
for archV in "SNB snb" "KNL knl" #"SKL skl"
for archV in "SNB snb" "KNL knl" "SKL-SP skl-sp"
do echo ${archV} | while read -r archN archO
do
echo "Extract benchmarking results for" ${archN}
Expand Down
23 changes: 2 additions & 21 deletions plotting/makeBenchmarkPlots.C
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
#if !defined(__CINT__)
#include "plotting/PlotBenchmarks.hh"
#endif

void setupcpp11()
{
// customize ACLiC's behavior ...
TString o;
// customize MakeSharedLib
o = TString(gSystem->GetMakeSharedLib());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeSharedLib(o.Data());
// customize MakeExe
o = TString(gSystem->GetMakeExe());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeExe(o.Data());
}
#include "PlotBenchmarks.hh"
#include "PlotBenchmarks.cpp"

void makeBenchmarkPlots(const TString & arch, const TString & sample)
{
setupcpp11(); // use this to get PlotBenchmarks to compile ... phiphi ROOT build has ACLiC with C++98!

gROOT->LoadMacro("plotting/PlotBenchmarks.cpp+g");

PlotBenchmarks Benchmarks(arch,sample);
Benchmarks.RunBenchmarkPlots();
}
8 changes: 4 additions & 4 deletions plotting/makeBenchmarkPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import math

def run():
arch = sys.argv[1] # SNB, KNL, SKL
arch = sys.argv[1] # SNB, KNL, SKL-SP
sample = sys.argv[2]

g = ROOT.TFile('benchmark_'+arch+'_'+sample+'.root','recreate')
Expand All @@ -16,7 +16,7 @@ def run():
vuvals = ['1','2','4','8']
nth = '1'

if arch == 'KNL' or arch == 'SKL' :
if arch == 'KNL' or arch == 'SKL-SP' :
vuvals.append('16')
vuvals.append('16int')
elif arch == 'SNB' :
Expand All @@ -36,9 +36,9 @@ def run():
elif arch == 'SNB' :
nvu = '8int'
thvals = ['1','2','4','6','8','12','16','20','24']
elif arch == 'SKL' :
elif arch == 'SKL-SP' :
nvu = '16int'
thvals = ['1','2','4','8','16','32','48']
thvals = ['1','2','4','8','16','32','48','64']
else :
print arch,'is not a valid architecture! Exiting...'
sys.exit(0)
Expand Down
23 changes: 2 additions & 21 deletions plotting/makeMEIFBenchmarkPlots.C
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
#if !defined(__CINT__)
#include "plotting/PlotMEIFBenchmarks.hh"
#endif

void setupcpp11()
{
// customize ACLiC's behavior ...
TString o;
// customize MakeSharedLib
o = TString(gSystem->GetMakeSharedLib());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeSharedLib(o.Data());
// customize MakeExe
o = TString(gSystem->GetMakeExe());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeExe(o.Data());
}
#include "PlotMEIFBenchmarks.hh"
#include "PlotMEIFBenchmarks.cpp"

void makeMEIFBenchmarkPlots(const TString & arch, const TString & sample, const TString & build)
{
setupcpp11(); // use this to get PlotMEIFBenchmarks to compile ... phiphi ROOT build has ACLiC with C++98!

gROOT->LoadMacro("plotting/PlotMEIFBenchmarks.cpp+g");

PlotMEIFBenchmarks MEIFBenchmarks(arch,sample,build);
MEIFBenchmarks.RunMEIFBenchmarkPlots();
}
8 changes: 4 additions & 4 deletions plotting/makeMEIFBenchmarkPlots.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import array
import math

arch = sys.argv[1] # SNB, KNL, SKL
arch = sys.argv[1] # SNB, KNL, SKL-SP
sample = sys.argv[2]
build = sys.argv[3] # CE, FV

Expand All @@ -18,10 +18,10 @@
nvu = '8int'
thvals = ['1','2','4','6','8','12','16','20','24']
evvals = ['1','2','4','8','12']
elif arch == 'SKL' :
elif arch == 'SKL-SP' :
nvu = '16int'
thvals = ['1','2','4','8','16','32','48']
evvals = ['1','2','4','8','16','32']
thvals = ['1','2','4','8','16','32','48','64']
evvals = ['1','2','4','8','16','32','64']
else :
print arch,"is not a valid architecture! Exiting..."
sys.exit(0)
Expand Down
23 changes: 2 additions & 21 deletions plotting/makePlotsFromDump.C
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
#if !defined(__CINT__)
#include "plotting/PlotsFromDump.hh"
#endif

void setupcpp11()
{
// customize ACLiC's behavior ...
TString o;
// customize MakeSharedLib
o = TString(gSystem->GetMakeSharedLib());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeSharedLib(o.Data());
// customize MakeExe
o = TString(gSystem->GetMakeExe());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeExe(o.Data());
}
#include "PlotsFromDump.hh"
#include "PlotsFromDump.cpp"

void makePlotsFromDump(const TString & sample, const TString & build)
{
setupcpp11(); // use this to get PlotsFromDump to compile ... phiphi ROOT build has ACLiC with C++98!

gROOT->LoadMacro("plotting/PlotsFromDump.cpp+g");

PlotsFromDump Plots(sample,build);
Plots.RunPlotsFromDump();
}
23 changes: 2 additions & 21 deletions plotting/makeValidation.C
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
#if !defined(__CINT__)
#include "plotting/StackValidation.hh"
#endif

void setupcpp11()
{
// customize ACLiC's behavior ...
TString o;
// customize MakeSharedLib
o = TString(gSystem->GetMakeSharedLib());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeSharedLib(o.Data());
// customize MakeExe
o = TString(gSystem->GetMakeExe());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeExe(o.Data());
}
#include "StackValidation.hh"
#include "StackValidation.cpp"

void makeValidation(const TString & label = "", const TString & extra = "", const Bool_t cmsswComp = false)
{
setupcpp11(); // use this to get StackValidation to compile ... phiphi ROOT build has ACLiC with C++98!

gROOT->LoadMacro("plotting/StackValidation.cpp+g");

StackValidation Stacks(label,extra,cmsswComp);
Stacks.MakeValidationStacks();
}
22 changes: 2 additions & 20 deletions plotting/runValidation.C
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#if !defined(__CINT__)
#include "plotting/PlotValidation.hh"
#endif

void setupcpp11()
{ // customize ACLiC's behavior ...
TString o;
// customize MakeSharedLib
o = TString(gSystem->GetMakeSharedLib());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeSharedLib(o.Data());
// customize MakeExe
o = TString(gSystem->GetMakeExe());
o = o.ReplaceAll(" -c ", " -std=c++0x -c ");
gSystem->SetMakeExe(o.Data());
}
#include "PlotValidation.hh"
#include "PlotValidation.cpp"

void runValidation(const TString & test = "", const Bool_t cmsswComp = false, const Bool_t mvInput = true,
const Bool_t saveAs = false, const TString & image = "pdf")
{
setupcpp11(); // use this to get PlotValidation to compile ... phiphi ROOT build has ACLiC with C++98!

gROOT->LoadMacro("plotting/PlotValidation.cpp+g");

// PlotValidation arguments
// First is additional input name of root file
// Second is name of output directory
Expand Down
Loading

0 comments on commit e518d34

Please sign in to comment.