Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Monitor
Incidents
Service Desk
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
d5bf77e5
Commit
d5bf77e5
authored
8 years ago
by
René Heß
Browse files
Options
Downloads
Patches
Plain Diff
Time residual evaluation
parent
41beb839
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/perftool/pdelab/driver.py
+50
-17
50 additions, 17 deletions
python/dune/perftool/pdelab/driver.py
with
50 additions
and
17 deletions
python/dune/perftool/pdelab/driver.py
+
50
−
17
View file @
d5bf77e5
...
...
@@ -1313,23 +1313,6 @@ def name_test_fail_variable():
return
name
@preamble
def
print_residual
():
ini
=
name_initree
()
formdata
=
_driver_data
[
'
formdata
'
]
n_go
=
name_gridoperator
(
formdata
)
v
=
name_vector
(
formdata
)
t_v
=
type_vector
(
formdata
)
return
[
"
if ({}.get<bool>(
\"
printresidual
\"
, false)) {{
"
.
format
(
ini
),
"
using Dune::PDELab::Backend::native;
"
,
"
{} r({});
"
.
format
(
t_v
,
v
),
"
r=0.0;
"
,
"
{}.residual({}, r);
"
.
format
(
n_go
,
v
),
"
Dune::printvector(std::cout, native(r),
\"
residual vector
\"
,
\"
row
\"
);
"
,
"
}
"
]
@cached
def
setup_timer
():
assert
(
get_option
(
'
timer
'
))
...
...
@@ -1349,6 +1332,38 @@ def define_exec():
return
"
char* exec = argv[0];
"
@preamble
def
evaluate_residual_timer
():
formdata
=
_driver_data
[
'
formdata
'
]
n_go
=
name_gridoperator
(
formdata
)
v
=
name_vector
(
formdata
)
t_v
=
type_vector
(
formdata
)
# Write back times
setup_timer
()
from
dune.perftool.generation
import
post_include
post_include
(
"
HP_DECLARE_TIMER(residual_evaluation);
"
,
filetag
=
"
driver
"
)
timestream
=
name_timing_stream
()
define_exec
()
print_times
=
[]
from
dune.perftool.generation
import
get_global_context_value
formdatas
=
get_global_context_value
(
"
formdatas
"
)
for
formdata
in
formdatas
:
lop_name
=
name_localoperator
(
formdata
)
print_times
.
append
(
"
{}.dump_timers({}, argv[0], true);
"
.
format
(
lop_name
,
timestream
))
evaluation
=
[
"
using Dune::PDELab::Backend::native;
"
,
"
{} r({});
"
.
format
(
t_v
,
v
),
"
r=0.0;
"
,
"
HP_TIMER_START(residual_evaluation);
"
,
"
{}.residual({}, r);
"
.
format
(
n_go
,
v
),
"
HP_TIMER_STOP(residual_evaluation);
"
,
"
DUMP_TIMER(residual_evaluation, {}, true);
"
.
format
(
timestream
)]
evaluation
.
extend
(
print_times
)
return
evaluation
@preamble
def
assemble_matrix_timer
():
formdata
=
_driver_data
[
'
formdata
'
]
...
...
@@ -1381,6 +1396,23 @@ def assemble_matrix_timer():
return
assembly
@preamble
def
print_residual
():
ini
=
name_initree
()
formdata
=
_driver_data
[
'
formdata
'
]
n_go
=
name_gridoperator
(
formdata
)
v
=
name_vector
(
formdata
)
t_v
=
type_vector
(
formdata
)
return
[
"
if ({}.get<bool>(
\"
printresidual
\"
, false)) {{
"
.
format
(
ini
),
"
using Dune::PDELab::Backend::native;
"
,
"
{} r({});
"
.
format
(
t_v
,
v
),
"
r=0.0;
"
,
"
{}.residual({}, r);
"
.
format
(
n_go
,
v
),
"
Dune::printvector(std::cout, native(r),
\"
residual vector
\"
,
\"
row
\"
);
"
,
"
}
"
]
@preamble
def
print_matrix
():
formdata
=
_driver_data
[
'
formdata
'
]
...
...
@@ -1593,6 +1625,7 @@ def generate_driver(formdatas, data):
if
get_option
(
"
opcounter
"
):
# In case of operator conunting we only assemble the matrix and evaluate the residual
assemble_matrix_timer
()
evaluate_residual_timer
()
elif
is_stationary
():
# We could also use solve if we are not interested in visualization
vtkoutput
()
...
...
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