Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
taehyounpark committed Mar 28, 2024
1 parent 38c25cb commit 7b43177
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions docs/pages/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ float DiElectronsMass(ConstDataVector<xAOD::ElectronContainer> const &els) {
return (els[0]->p4() + els[1]->p4()).M();
};
void analyze(unsigned int n) {
dataflow df(multithread::enable(n));
int main(int argc, char *argv[]) {
dataflow df;
auto ds = df.load(dataset::input<Event>(daodFiles, treeName));
auto eventInfo = ds.read(dataset::column<xAOD::EventInfo>("EventInfo"));
Expand All @@ -399,28 +399,13 @@ void analyze(unsigned int n) {
selectedElectronsPtHist->Draw();
gPad->SetLogy();
gPad->Print("mee.pdf");
}
int main(int argc, char *argv[]) {
int nthreads = 0;
if (argc==2) { nthreads=strtol(argv[1], nullptr, 0); }
auto tic = std::chrono::steady_clock::now();
analyze(nthreads);
auto toc = std::chrono::steady_clock::now();
std::chrono::duration<double> elapsed_seconds = toc-tic;
std::cout << "elapsed time (" << nthreads << " threads) = " << elapsed_seconds.count() << "s"
<< std::endl;
return 0;
}
@endcpp
@image html mee.png
@out
elapsed time (1 threads) = 63.0538s
elapsed time (10 threads) = 10.4677s
@endout
@section example-task7 IRIS-HEP ADL benchmark
- Collision dataset: [2012 CMS open data](http://opendata.cern.ch/record/6021) (16 GiB, 53 million events).
Expand Down

0 comments on commit 7b43177

Please sign in to comment.