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
4da2402d
Commit
4da2402d
authored
11 months ago
by
Dominik Smith
Browse files
Options
Downloads
Patches
Plain Diff
Fixed error in module-partitioning of trd::Hitfind output on multiple threads.
parent
bdf5f245
No related branches found
No related tags found
1 merge request
!1792
Fixed error in module-partitioning of trd::Hitfind output on multiple threads.
Pipeline
#29156
passed
11 months ago
Stage: build
Stage: package
Stage: verify
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
algo/detectors/trd/Hitfind.cxx
+27
-10
27 additions, 10 deletions
algo/detectors/trd/Hitfind.cxx
with
27 additions
and
10 deletions
algo/detectors/trd/Hitfind.cxx
+
27
−
10
View file @
4da2402d
...
...
@@ -186,12 +186,14 @@ namespace cbm::algo::trd
monitor
.
timeClusterize
=
xpu
::
pop_timer
();
// Hit finding
PODVector
<
Hit
>
hitsFlat
;
// hit storage
std
::
v
ector
<
size_t
>
modSizes
(
fModList
.
size
())
;
// nHits per modules
std
::
v
ector
<
uint
>
modAddresses
(
fModList
.
size
())
;
// address of modules
PODVector
<
Hit
>
hitsFlat
;
// hit storage
PODV
ector
<
size_t
>
modSizes
;
// nHits per modules
PODV
ector
<
uint
>
modAddresses
;
// address of modules
// Prefix array for parallelization
std
::
vector
<
size_t
>
hitsPrefix
;
std
::
vector
<
size_t
>
sizePrefix
;
std
::
vector
<
size_t
>
addrPrefix
;
xpu
::
push_timer
(
"FindHits"
);
CBM_PARALLEL
()
...
...
@@ -199,9 +201,16 @@ namespace cbm::algo::trd
const
int
ithread
=
openmp
::
GetThreadNum
();
const
int
nthreads
=
openmp
::
GetNumThreads
();
CBM_OMP
(
single
)
{
hitsPrefix
.
resize
(
nthreads
+
1
);
}
CBM_OMP
(
single
)
{
hitsPrefix
.
resize
(
nthreads
+
1
);
sizePrefix
.
resize
(
nthreads
+
1
);
addrPrefix
.
resize
(
nthreads
+
1
);
}
std
::
vector
<
Hit
>
local_hits
;
std
::
vector
<
size_t
>
local_sizes
;
std
::
vector
<
uint
>
local_addresses
;
CBM_OMP
(
for
schedule
(
dynamic
)
nowait
)
for
(
size_t
mod
=
0
;
mod
<
fModList
.
size
();
mod
++
)
{
...
...
@@ -228,27 +237,35 @@ namespace cbm::algo::trd
//sort(clusters.begin(), clusters.end(), [](const auto& a, const auto& b) { return a.GetStartTime() < b.GetStartTime(); });
mod_hits
=
(
*
fHitFind
[
address
])(
&
clusters
);
}
// Append clusters to output
local_hits
.
insert
(
local_hits
.
end
(),
std
::
make_move_iterator
(
mod_hits
.
begin
()),
std
::
make_move_iterator
(
mod_hits
.
end
()));
// store partition size
modSizes
[
mod
]
=
mod_hits
.
size
();
local_sizes
.
push_back
(
mod_hits
.
size
()
)
;
// store hw address of partition
modAddresses
[
mod
]
=
address
;
local_addresses
.
push_back
(
address
);
// Append clusters to output
local_hits
.
insert
(
local_hits
.
end
(),
std
::
make_move_iterator
(
mod_hits
.
begin
()),
std
::
make_move_iterator
(
mod_hits
.
end
()));
}
hitsPrefix
[
ithread
+
1
]
=
local_hits
.
size
();
sizePrefix
[
ithread
+
1
]
=
local_sizes
.
size
();
addrPrefix
[
ithread
+
1
]
=
local_addresses
.
size
();
CBM_OMP
(
barrier
)
CBM_OMP
(
single
)
{
for
(
int
i
=
1
;
i
<
(
nthreads
+
1
);
i
++
)
{
hitsPrefix
[
i
]
+=
hitsPrefix
[
i
-
1
];
sizePrefix
[
i
]
+=
sizePrefix
[
i
-
1
];
addrPrefix
[
i
]
+=
addrPrefix
[
i
-
1
];
}
hitsFlat
.
resize
(
hitsPrefix
[
nthreads
]);
modSizes
.
resize
(
sizePrefix
[
nthreads
]);
modAddresses
.
resize
(
addrPrefix
[
nthreads
]);
}
std
::
move
(
local_hits
.
begin
(),
local_hits
.
end
(),
hitsFlat
.
begin
()
+
hitsPrefix
[
ithread
]);
std
::
move
(
local_sizes
.
begin
(),
local_sizes
.
end
(),
modSizes
.
begin
()
+
sizePrefix
[
ithread
]);
std
::
move
(
local_addresses
.
begin
(),
local_addresses
.
end
(),
modAddresses
.
begin
()
+
addrPrefix
[
ithread
]);
}
// Monitoring
monitor
.
timeHitfind
=
xpu
::
pop_timer
();
...
...
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