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
1b5cebfc
Commit
1b5cebfc
authored
1 year ago
by
Felix Weiglhofer
Browse files
Options
Downloads
Patches
Plain Diff
StsReco: Disable GPU Hitfinder.
parent
369e4796
No related branches found
No related tags found
1 merge request
!1161
algo: Update STS GPU Reco
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
algo/base/gpu/xpu_legacy.h
+1
-1
1 addition, 1 deletion
algo/base/gpu/xpu_legacy.h
reco/detectors/sts/CbmRecoSts.cxx
+45
-37
45 additions, 37 deletions
reco/detectors/sts/CbmRecoSts.cxx
reco/detectors/sts/CbmRecoSts.h
+1
-1
1 addition, 1 deletion
reco/detectors/sts/CbmRecoSts.h
with
47 additions
and
39 deletions
algo/base/gpu/xpu_legacy.h
+
1
−
1
View file @
1b5cebfc
...
...
@@ -19,7 +19,7 @@ namespace xpu
hd_buffer
()
=
default
;
hd_buffer
(
size_t
size
)
:
m_buffer
(
size
,
xpu
::
buf_io
)
{}
T
*
h
()
{
return
xpu
::
h_view
(
m_buffer
).
begin
();
}
T
*
h
()
{
return
xpu
::
h_view
<
T
>
(
m_buffer
).
begin
();
}
T
*
d
()
{
return
m_buffer
.
get
();
}
xpu
::
buffer
<
T
>&
underlying
()
{
return
m_buffer
;
}
...
...
This diff is collapsed.
Click to expand it.
reco/detectors/sts/CbmRecoSts.cxx
+
45
−
37
View file @
1b5cebfc
...
...
@@ -35,6 +35,8 @@
#include
<xpu/host.h>
#include
"sts/HitfinderPars.h"
#if __has_include(<omp.h>)
#include
<omp.h>
#endif
...
...
@@ -71,7 +73,7 @@ UInt_t CbmRecoSts::CreateModules()
assert
(
fSetup
);
std
::
vector
<
cbm
::
algo
::
S
tsModule
Par
>
gpuModules
;
// for gpu reco
std
::
vector
<
cbm
::
algo
::
s
ts
::
HitfinderPars
::
Module
>
gpuModules
;
// for gpu reco
// std::vector<int> moduleAddrs;
// std::vector<experimental::CbmStsHitFinderConfig> hfCfg;
...
...
@@ -133,13 +135,13 @@ UInt_t CbmRecoSts::CreateModules()
fModuleIndex
.
push_back
(
recoModule
);
// Get Transformation Matrix
cbm
::
algo
::
S
tsModuleTransform
ationMatrix
localToGlobal
;
cbm
::
algo
::
s
ts
::
HitfinderPars
::
ModuleTransform
localToGlobal
;
TGeoHMatrix
*
matrix
=
recoModule
->
getMatrix
();
std
::
copy_n
(
matrix
->
GetRotationMatrix
(),
9
,
localToGlobal
.
rotation
.
begin
());
std
::
copy_n
(
matrix
->
GetTranslation
(),
3
,
localToGlobal
.
translation
.
begin
());
// Collect GPU parameters
cbm
::
algo
::
S
tsModule
Par
gpuModulePars
{
cbm
::
algo
::
s
ts
::
HitfinderPars
::
Module
gpuModulePars
{
.
address
=
moduleAddress
,
.
dY
=
sensPar
.
GetPar
(
3
),
.
pitch
=
sensPar
.
GetPar
(
6
),
...
...
@@ -155,7 +157,7 @@ UInt_t CbmRecoSts::CreateModules()
const
CbmStsParModule
&
firstModulePars
=
fParSetModule
->
GetParModule
(
gpuModules
[
0
].
address
);
CbmStsParAsic
asic
=
firstModulePars
.
GetParAsic
(
0
);
cbm
::
algo
::
S
tsAsic
Par
algoAsic
{
cbm
::
algo
::
s
ts
::
HitfinderPars
::
Asic
algoAsic
{
.
nAdc
=
asic
.
GetNofAdc
(),
.
dynamicRange
=
float
(
asic
.
GetDynRange
()),
.
threshold
=
float
(
asic
.
GetThreshold
()),
...
...
@@ -170,7 +172,7 @@ UInt_t CbmRecoSts::CreateModules()
auto
[
landauValues
,
landauStepSize
]
=
CbmStsPhysics
::
Instance
()
->
GetLandauWidthTable
();
std
::
vector
<
float
>
landauValuesF
;
std
::
copy
(
landauValues
.
begin
(),
landauValues
.
end
(),
std
::
back_inserter
(
landauValuesF
));
cbm
::
algo
::
S
tsHitfinderPar
pars
{
cbm
::
algo
::
s
ts
::
HitfinderPar
s
pars
{
.
asic
=
algoAsic
,
.
nChannels
=
nChannels
,
.
modules
=
gpuModules
,
...
...
@@ -286,7 +288,8 @@ void CbmRecoSts::Finish()
Double_t
clusterHit
=
Double_t
(
fNofClusters
)
/
Double_t
(
fNofHits
);
LOG
(
info
)
<<
"====================================="
;
LOG
(
info
)
<<
GetName
()
<<
": Run summary"
;
if
(
fUseGpuReco
)
LOG
(
info
)
<<
"Ran new GPU STS reconstruction. (Device "
<<
xpu
::
device_properties
().
name
<<
")"
;
if
(
fUseGpuReco
)
LOG
(
info
)
<<
"Ran new GPU STS reconstruction. (Device "
<<
xpu
::
device_prop
(
xpu
::
device
::
active
()).
name
()
<<
")"
;
else
if
(
ompThreads
<
0
)
LOG
(
info
)
<<
"STS reconstruction ran single threaded (No OpenMP)."
;
else
...
...
@@ -343,25 +346,26 @@ void CbmRecoSts::Finish()
<<
throughput
(
fNofClusters
*
sizeof
(
CbmStsCluster
),
1000.
*
fTimeFindHits
)
<<
" GB/s)"
;
}
else
{
cbm
::
algo
::
StsHitfinderTimes
times
=
fGpuReco
.
GetHitfinderTimes
();
double
gpuHitfinderTimeTotal
=
times
.
timeSortDigi
+
times
.
timeCluster
+
times
.
timeSortCluster
+
times
.
timeHits
;
double
sortDigiThroughput
=
throughput
(
fNofDigis
*
sizeof
(
CbmStsDigi
),
times
.
timeSortDigi
);
double
findClusterThroughput
=
throughput
(
fNofDigis
*
sizeof
(
CbmStsDigi
),
times
.
timeCluster
);
double
sortClusterThroughput
=
throughput
(
fNofClusters
*
8
,
times
.
timeSortCluster
);
double
findHitThroughput
=
throughput
(
fNofClusters
*
24
,
times
.
timeHits
);
LOG
(
info
)
<<
"Time Reconstruct (GPU) : "
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
6
)
<<
gpuHitfinderTimeTotal
<<
" ms"
;
LOG
(
info
)
<<
"Time by step:
\n
"
<<
" Sort Digi : "
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
6
)
<<
times
.
timeSortDigi
<<
" ms ("
<<
sortDigiThroughput
<<
" GB/s)
\n
"
<<
" Find Cluster: "
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
6
)
<<
times
.
timeCluster
<<
" ms ("
<<
findClusterThroughput
<<
" GB/s)
\n
"
<<
" Sort Cluster: "
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
6
)
<<
times
.
timeSortCluster
<<
" ms ("
<<
sortClusterThroughput
<<
" GB/s)
\n
"
<<
" Find Hits : "
<<
fixed
<<
setprecision
(
2
)
<<
setw
(
6
)
<<
times
.
timeHits
<<
"ms ("
<<
findHitThroughput
<<
" GB/s)"
;
LOG
(
warn
)
<<
"Hitfinder times collected by cbm::algo::Reco"
;
// cbm::algo::StsHitfinderTimes times = fGpuReco.GetHitfinderTimes();
// double gpuHitfinderTimeTotal = times.timeSortDigi + times.timeCluster + times.timeSortCluster + times.timeHits;
// double sortDigiThroughput = throughput(fNofDigis * sizeof(CbmStsDigi), times.timeSortDigi);
// double findClusterThroughput = throughput(fNofDigis * sizeof(CbmStsDigi), times.timeCluster);
// double sortClusterThroughput = throughput(fNofClusters * 8, times.timeSortCluster);
// double findHitThroughput = throughput(fNofClusters * 24, times.timeHits);
// LOG(info) << "Time Reconstruct (GPU) : " << fixed << setprecision(2) << setw(6) << gpuHitfinderTimeTotal << " ms";
// LOG(info) << "Time by step:\n"
// << " Sort Digi : " << fixed << setprecision(2) << setw(6) << times.timeSortDigi << " ms ("
// << sortDigiThroughput << " GB/s)\n"
// << " Find Cluster: " << fixed << setprecision(2) << setw(6) << times.timeCluster << " ms ("
// << findClusterThroughput << " GB/s)\n"
// << " Sort Cluster: " << fixed << setprecision(2) << setw(6) << times.timeSortCluster << " ms ("
// << sortClusterThroughput << " GB/s)\n"
// << " Find Hits : " << fixed << setprecision(2) << setw(6) << times.timeHits << "ms ("
// << findHitThroughput << " GB/s)";
}
LOG
(
info
)
<<
"====================================="
;
}
...
...
@@ -736,6 +740,7 @@ void CbmRecoSts::ProcessDataGpu()
std
::
pair
<
size_t
,
size_t
>
CbmRecoSts
::
ForwardGpuClusterAndHits
()
{
#if 0
size_t nClustersForwarded = 0, nHitsForwarded = 0;
const cbm::algo::StsHitfinderHost& hfc = fGpuReco.GetHitfinderBuffers();
...
...
@@ -804,6 +809,8 @@ std::pair<size_t, size_t> CbmRecoSts::ForwardGpuClusterAndHits()
} // for (int module = 0; module < hfc.nModules; module++)
return {nClustersForwarded, nHitsForwarded};
#endif
return
{
0
,
0
};
}
...
...
@@ -820,18 +827,19 @@ void CbmRecoSts::SetParContainers()
void
CbmRecoSts
::
DumpNewHits
()
{
std
::
ofstream
out
{
"newHits.csv"
};
const
cbm
::
algo
::
StsHitfinderHost
&
hfc
=
fGpuReco
.
GetHitfinderBuffers
();
out
<<
"module, x, y, z, deltaX, deltaY, deltaZ, deltaXY, time, timeError, deltaU, deltaV"
<<
std
::
endl
;
for
(
size_t
m
=
0
;
m
<
fModuleIndex
.
size
();
m
++
)
{
int
nHitsGpu
=
hfc
.
nHitsPerModule
.
h
()[
m
];
auto
*
gpuHits
=
&
hfc
.
hitsPerModule
.
h
()[
m
*
hfc
.
maxHitsPerModule
];
for
(
int
i
=
0
;
i
<
nHitsGpu
;
i
++
)
{
auto
&
h
=
gpuHits
[
i
];
out
<<
m
<<
", "
<<
h
.
fX
<<
", "
<<
h
.
fY
<<
", "
<<
h
.
fZ
<<
", "
<<
h
.
fDx
<<
", "
<<
h
.
fDy
<<
", "
<<
h
.
fDz
<<
", "
<<
h
.
fDxy
<<
", "
<<
h
.
fTime
<<
", "
<<
h
.
fTimeError
<<
", "
<<
h
.
fDu
<<
", "
<<
h
.
fDv
<<
std
::
endl
;
}
}
LOG
(
warn
)
<<
"DumpNewHits() not implemented yet"
;
// std::ofstream out {"newHits.csv"};
// const cbm::algo::StsHitfinderHost& hfc = fGpuReco.GetHitfinderBuffers();
// out << "module, x, y, z, deltaX, deltaY, deltaZ, deltaXY, time, timeError, deltaU, deltaV" << std::endl;
// for (size_t m = 0; m < fModuleIndex.size(); m++) {
// int nHitsGpu = hfc.nHitsPerModule.h()[m];
// auto* gpuHits = &hfc.hitsPerModule.h()[m * hfc.maxHitsPerModule];
// for (int i = 0; i < nHitsGpu; i++) {
// auto& h = gpuHits[i];
// out << m << ", " << h.fX << ", " << h.fY << ", " << h.fZ << ", " << h.fDx << ", " << h.fDy << ", " << h.fDz
// << ", " << h.fDxy << ", " << h.fTime << ", " << h.fTimeError << ", " << h.fDu << ", " << h.fDv << std::endl;
// }
// }
}
void
CbmRecoSts
::
DumpOldHits
()
...
...
This diff is collapsed.
Click to expand it.
reco/detectors/sts/CbmRecoSts.h
+
1
−
1
View file @
1b5cebfc
...
...
@@ -330,7 +330,7 @@ private:
std
::
vector
<
CbmStsRecoModule
*>
fModuleIndex
{};
//!
bool
fUseGpuReco
=
false
;
cbm
::
algo
::
S
tsHitfinderChain
fGpuReco
;
cbm
::
algo
::
s
ts
::
HitfinderChain
fGpuReco
;
std
::
pair
<
size_t
,
size_t
>
ForwardGpuClusterAndHits
();
...
...
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