Skip to content

Speedup in TOF matching#7053

Merged
davidrohr merged 5 commits into
AliceO2Group:devfrom
chiarazampolli:speedup
Sep 18, 2021
Merged

Speedup in TOF matching#7053
davidrohr merged 5 commits into
AliceO2Group:devfrom
chiarazampolli:speedup

Conversation

@chiarazampolli
Copy link
Copy Markdown
Collaborator

@chiarazampolli chiarazampolli commented Sep 16, 2021

Speed-up on 600 PbPb events generated by @davidrohr 👍
dev:
[19467:tof-matcher]: [16:51:08][INFO] Timing Do Matching: Cpu: 3.776e+01 s Real: 3.772e+01 s in 0 slots
[19467:tof-matcher]: [16:51:08][INFO] Timing Do Matching ITSTPC: Cpu: 0.000e+00 s Real: 0.000e+00 s in 0 slots
[19467:tof-matcher]: [16:51:08][INFO] Timing Do Matching TPC : Cpu: 3.755e+01 s Real: 3.751e+01 s in 17 slots
[19467:tof-matcher]: [16:51:08][INFO] Shifting Z for 334358 matched TPC tracks according to TOF time info
[19468:TOFCalibWriter]: [16:51:09][INFO] RECEIVED MATCHED SIZE 334358
[19467:tof-matcher]: [16:51:09][INFO] TOF matching total timing: Cpu: 5.215e+01 Real: 5.211e+01 s in 1 slots
[19469:TOFMatchedWriter_TPC]: [16:51:09][INFO] RECEIVED MATCHED SIZE 334358

this branch:
[5487:tof-matcher]: [16:42:51][INFO] Timing Do Matching: Cpu: 2.891e+01 s Real: 2.888e+01 s in 0 slots
[5487:tof-matcher]: [16:42:51][INFO] Timing Do Matching ITSTPC: Cpu: 0.000e+00 s Real: 0.000e+00 s in 0 slots
[5487:tof-matcher]: [16:42:51][INFO] Timing Do Matching TPC : Cpu: 2.870e+01 s Real: 2.866e+01 s in 17 slots
[5487:tof-matcher]: [16:42:51][INFO] Shifting Z for 334358 matched TPC tracks according to TOF time info
[5488:TOFCalibWriter]: [16:42:51][INFO] RECEIVED MATCHED SIZE 334358
[5487:tof-matcher]: [16:42:51][INFO] TOF matching total timing: Cpu: 4.460e+01 Real: 4.456e+01 s in 1 slots

==> ~25%

Compared to the initial measurements (~536s for "Timing Do Matching TPC") ==> we get to a factor 18 improvement.
@noferini , please check that you "like" the changes, of course.

Further speedup

remove comments

clang-format

improve printout

A bit of comments
@chiarazampolli
Copy link
Copy Markdown
Collaborator Author

@shahor02 , @davidrohr , FYI. But @noferini still has to vet the modifications.

@noferini
Copy link
Copy Markdown
Collaborator

Hi Chiara,
I checked your changes. They look fine.
For my curiosity, do you also have also the change of the performance when matching simultaneously TPC and ITS-TPC tracks?

@chiarazampolli
Copy link
Copy Markdown
Collaborator Author

Here it is:

dev:
[23792:tof-matcher]: [17:14:02][INFO] Timing Do Matching: Cpu: 2.958e+01 s Real: 2.956e+01 s in 0 slots
[23792:tof-matcher]: [17:14:02][INFO] Timing Do Matching ITSTPC: Cpu: 3.990e+00 s Real: 3.988e+00 s in 17 slots
[23792:tof-matcher]: [17:14:02][INFO] Timing Do Matching TPC : Cpu: 2.543e+01 s Real: 2.541e+01 s in 17 slots
[23792:tof-matcher]: [17:14:02][INFO] Shifting Z for 213128 matched TPC tracks according to TOF time info
[23793:TOFCalibWriter]: [17:14:03][INFO] RECEIVED MATCHED SIZE 318549
[23794:TOFMatchedWriter]: [17:14:03][INFO] RECEIVED MATCHED SIZE 105421
[23792:tof-matcher]: [17:14:03][INFO] TOF matching total timing: Cpu: 4.394e+01 Real: 4.391e+01 s in 1 slots
[23795:TOFMatchedWriter_TPC]: [17:14:03][INFO] RECEIVED MATCHED SIZE 213128

speedup:

[22256:tof-matcher]: [17:10:26][INFO] Timing Do Matching: Cpu: 2.282e+01 s Real: 2.280e+01 s in 0 slots
[22256:tof-matcher]: [17:10:26][INFO] Timing Do Matching ITSTPC: Cpu: 3.540e+00 s Real: 3.524e+00 s in 17 slots
[22256:tof-matcher]: [17:10:26][INFO] Timing Do Matching TPC : Cpu: 1.912e+01 s Real: 1.911e+01 s in 17 slots
[22256:tof-matcher]: [17:10:26][INFO] Shifting Z for 213128 matched TPC tracks according to TOF time info
[22257:TOFCalibWriter]: [17:10:26][INFO] RECEIVED MATCHED SIZE 318549
[22258:TOFMatchedWriter]: [17:10:26][INFO] RECEIVED MATCHED SIZE 105421
[22259:TOFMatchedWriter_TPC]: [17:10:26][INFO] RECEIVED MATCHED SIZE 213128
[22256:tof-matcher]: [17:10:26][INFO] TOF matching total timing: Cpu: 3.721e+01 Real: 3.718e+01 s in 1 slots

==> ITS-TPC: ~12% faster than before;
==> TPC: ~33% faster

But I don't have the "TPC,ITS-TPC" from before any optmization.

noferini
noferini previously approved these changes Sep 16, 2021
Typo
@chiarazampolli
Copy link
Copy Markdown
Collaborator Author

Further improvement added as discussed with @noferini , like this the o2::tof::Geo::getSector() will be called much less. I will measure in detail next week.

@davidrohr davidrohr merged commit 2d413ea into AliceO2Group:dev Sep 18, 2021
@chiarazampolli
Copy link
Copy Markdown
Collaborator Author

Hello @noferini , @shahor02 , @davidrohr ,

With current dev:

*TPC only:
[143076:tof-matcher]: [22:36:30][INFO] Timing Do Matching: Cpu: 2.813e+01 s Real: 2.810e+01 s in 0 slots
[143076:tof-matcher]: [22:36:30][INFO] Timing Do Matching ITSTPC: Cpu: 0.000e+00 s Real: 0.000e+00 s in 0 slots
[143076:tof-matcher]: [22:36:30][INFO] Timing Do Matching TPC : Cpu: 2.787e+01 s Real: 2.786e+01 s in 17 slots
[143076:tof-matcher]: [22:36:30][INFO] Shifting Z for 334358 matched TPC tracks according to TOF time info
[143077:TOFCalibWriter]: [22:36:30][INFO] RECEIVED MATCHED SIZE 334358
[143076:tof-matcher]: [22:36:30][INFO] TOF matching total timing: Cpu: 4.375e+01 Real: 4.371e+01 s in 1 slots

*ITSTPC and TPC:
[143447:tof-matcher]: [22:39:35][INFO] Timing Do Matching: Cpu: 2.170e+01 s Real: 2.168e+01 s in 0 slots
[143447:tof-matcher]: [22:39:35][INFO] Timing Do Matching ITSTPC: Cpu: 3.520e+00 s Real: 3.498e+00 s in 17 slots
[143447:tof-matcher]: [22:39:35][INFO] Timing Do Matching TPC : Cpu: 1.802e+01 s Real: 1.802e+01 s in 17 slots
[143447:tof-matcher]: [22:39:35][INFO] Shifting Z for 213128 matched TPC tracks according to TOF time info
[143448:TOFCalibWriter]: [22:39:35][INFO] RECEIVED MATCHED SIZE 318549
[143449:TOFMatchedWriter]: [22:39:35][INFO] RECEIVED MATCHED SIZE 105421
[143450:TOFMatchedWriter_TPC]: [22:39:35][INFO] RECEIVED MATCHED SIZE 213128
[143447:tof-matcher]: [22:39:35][INFO] TOF matching total timing: Cpu: 3.608e+01 Real: 3.604e+01 s in 1 slots

So, not much after the very last commit, but everything helps.

Chiara

@chiarazampolli chiarazampolli deleted the speedup branch May 16, 2022 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants