Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
waLBerla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Zikeli
waLBerla
Commits
cecd6e10
Commit
cecd6e10
authored
4 months ago
by
Michael Zikeli
Browse files
Options
Downloads
Patches
Plain Diff
[skip ci] Add timer data exposure to Python callback in UniformGridCPU benchmark.
parent
b8ff6cf5
No related branches found
No related tags found
No related merge requests found
Pipeline
#73368
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/benchmarks/UniformGridCPU/UniformGridCPU.cpp
+27
-1
27 additions, 1 deletion
apps/benchmarks/UniformGridCPU/UniformGridCPU.cpp
with
27 additions
and
1 deletion
apps/benchmarks/UniformGridCPU/UniformGridCPU.cpp
+
27
−
1
View file @
cecd6e10
...
...
@@ -213,7 +213,6 @@ int main(int argc, char** argv)
WcTimingPool
timeloopTiming
;
WcTimer
simTimer
;
WALBERLA_MPI_WORLD_BARRIER
()
WALBERLA_LOG_INFO_ON_ROOT
(
"Starting simulation with "
<<
timesteps
<<
" time steps"
)
...
...
@@ -250,6 +249,33 @@ int main(int argc, char** argv)
pythonCallbackResults
.
data
().
exposeValue
(
"nontemporal"
,
nontemporal
);
pythonCallbackResults
.
data
().
exposeValue
(
"cse_global"
,
infoCseGlobal
);
pythonCallbackResults
.
data
().
exposeValue
(
"cse_pdfs"
,
infoCsePdfs
);
auto
exposeTimers
=
[
&
pythonCallbackResults
](
const
std
::
shared_ptr
<
WcTimingPool
>&
tp
){
std
::
string
parseColumnName
(
const
std
::
string
&
columnName
)
{
std
::
string
parsedName
=
columnName
;
std
::
replace
(
parsedName
.
begin
(),
parsedName
.
end
(),
' '
,
'-'
);
return
parsedName
;
}
auto
&
data
=
pythonCallbackResults
.
data
();
for
(
auto
i
=
tp
->
begin
();
i
!=
tp
->
end
();
++
i
)
{
const
std
::
string
timerName
=
"Timer_"
+
i
->
first
;
const
std
::
string
coulumnName
;
coulumnName
=
timerName
+
"_Total"
;
data
.
exposeValue
(
parseColumnName
(
coulumnName
).
c_str
(),
i
->
second
.
total
());
coulumnName
=
timerName
+
"_Average"
;
data
.
exposeValue
(
parseColumnName
(
coulumnName
).
c_str
(),
i
->
second
.
average
());
coulumnName
=
timerName
+
"_Count"
;
data
.
exposeValue
(
parseColumnName
(
coulumnName
).
c_str
(),
i
->
second
.
getCounter
());
coulumnName
=
timerName
+
"_Min"
;
data
.
exposeValue
(
parseColumnName
(
coulumnName
).
c_str
(),
i
->
second
.
min
());
coulumnName
=
timerName
+
"_Max"
;
data
.
exposeValue
(
parseColumnName
(
coulumnName
).
c_str
(),
i
->
second
.
max
());
coulumnName
=
timerName
+
"_Variance"
;
data
.
exposeValue
(
parseColumnName
(
coulumnName
).
c_str
(),
i
->
second
.
variance
());
}
};
exposeTimers
(
reducedTimeloopTiming
);
// Call Python function to report results
pythonCallbackResults
();
}
...
...
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