Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
cdc6c061
Commit
cdc6c061
authored
1 year ago
by
Felix Weiglhofer
Committed by
Dominik Smith
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
algo::Unpack: Add timers.
parent
d214378f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1219
algo: Unpack TOF and STS in parallel.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algo/unpack/Unpack.cxx
+18
-0
18 additions, 0 deletions
algo/unpack/Unpack.cxx
with
18 additions
and
0 deletions
algo/unpack/Unpack.cxx
+
18
−
0
View file @
cdc6c061
...
...
@@ -7,6 +7,8 @@
#include
<chrono>
#include
<xpu/host.h>
#include
"compat/Algorithm.h"
#include
"log.hpp"
...
...
@@ -17,6 +19,8 @@ namespace cbm::algo
// ----- Execution -------------------------------------------------------
Unpack
::
resultType
Unpack
::
operator
()(
const
fles
::
Timeslice
*
timeslice
)
{
xpu
::
scoped_timer
t0
(
"Unpack"
);
// --- Output data
resultType
result
=
{};
CbmDigiTimeslice
&
digiTs
=
result
.
first
;
...
...
@@ -25,6 +29,7 @@ namespace cbm::algo
ParallelInit
(
*
timeslice
);
if
(
DetectorEnabled
(
fles
::
SubsystemIdentifier
::
STS
))
{
xpu
::
scoped_timer
t1
(
"STS"
);
ParallelMsLoop
(
digiTs
.
fData
.
fSts
.
fDigis
,
monitor
.
fSts
,
*
timeslice
,
0x20
);
}
...
...
@@ -36,6 +41,8 @@ namespace cbm::algo
if
(
!
DetectorEnabled
(
systemId
))
continue
;
xpu
::
scoped_timer
t1
(
fles
::
to_string
(
systemId
));
// Equipment ID of current component
const
uint16_t
equipmentId
=
timeslice
->
descriptor
(
comp
,
0
).
eq_id
;
...
...
@@ -68,6 +75,8 @@ namespace cbm::algo
}
//# component
// --- Sorting of output digis. Is required by both digi trigger and event builder.
xpu
::
scoped_timer
t2
(
"Sort"
);
Sort
(
digiTs
.
fData
.
fSts
.
fDigis
.
begin
(),
digiTs
.
fData
.
fSts
.
fDigis
.
end
(),
[](
CbmStsDigi
digi1
,
CbmStsDigi
digi2
)
{
return
digi1
.
GetTime
()
<
digi2
.
GetTime
();
});
Sort
(
digiTs
.
fData
.
fMuch
.
fDigis
.
begin
(),
digiTs
.
fData
.
fMuch
.
fDigis
.
end
(),
...
...
@@ -305,6 +314,8 @@ namespace cbm::algo
// ----------------------------------------------------------------------------
void
Unpack
::
ParallelInit
(
const
fles
::
Timeslice
&
timeslice
)
{
xpu
::
scoped_timer
t
(
"ParallelInit"
);
fParallelStsSetup
=
{};
size_t
numMs
=
0
;
...
...
@@ -341,19 +352,25 @@ namespace cbm::algo
auto
&
msDigis
=
fParallelStsSetup
.
msDigis
;
size_t
numMs
=
msDigis
.
size
();
xpu
::
push_timer
(
"Unpack"
);
#pragma omp parallel for schedule(dynamic)
for
(
size_t
i
=
0
;
i
<
numMs
;
i
++
)
{
auto
result
=
fAlgoSts
.
at
(
msEqIds
[
i
])(
msContent
[
i
],
msDesc
[
i
],
ts
.
start_time
());
msDigis
[
i
]
=
std
::
move
(
result
.
first
);
monitor
[
i
]
=
std
::
move
(
result
.
second
);
}
xpu
::
pop_timer
();
size_t
nDigisTotal
=
0
;
for
(
const
auto
&
digis
:
msDigis
)
{
nDigisTotal
+=
digis
.
size
();
}
xpu
::
push_timer
(
"Resize"
);
digisOut
.
resize
(
nDigisTotal
);
xpu
::
pop_timer
();
xpu
::
push_timer
(
"Merge"
);
#pragma omp parallel for schedule(dynamic)
for
(
unsigned
int
i
=
0
;
i
<
numMs
;
i
++
)
{
unsigned
int
offset
=
0
;
...
...
@@ -361,6 +378,7 @@ namespace cbm::algo
offset
+=
msDigis
[
x
].
size
();
std
::
copy
(
msDigis
[
i
].
begin
(),
msDigis
[
i
].
end
(),
digisOut
.
begin
()
+
offset
);
}
xpu
::
pop_timer
();
monitorOut
=
std
::
move
(
monitor
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment