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
326c9945
"python/dune/codegen/blockstructured/accumulation.py" did not exist on "d1b9da833e2536e500784c576827c133fa3e7153"
Commit
326c9945
authored
8 years ago
by
René Heß
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup dry run dummy construction
parent
48b2991d
No related branches found
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/sumfact/sumfact.py
+14
-41
14 additions, 41 deletions
python/dune/perftool/sumfact/sumfact.py
with
14 additions
and
41 deletions
python/dune/perftool/sumfact/sumfact.py
+
14
−
41
View file @
326c9945
...
...
@@ -282,49 +282,22 @@ def generate_accumulation_instruction(visitor, accterm, measure, subdomain_id):
(
maybe_wrap_subscript
(
result
,
prim
.
Variable
(
iname
)),),
)
# In the
case of FastDGGridOperator we can wri
te directly in
to
the
resiudal/jacobi
# In the
fastdg case we accumula
te directly in the
last step of the SF!
if
get_option
(
'
fastdg
'
):
# TODO: We accumulate the result directly in the last step
# of the sumfactorization. This part of code is only here
# because the pymbolic sumfactorization node seems to
# vanish if there is no assignement afterwards. In the dry
# run we force the node to be present by doing an
# assignement here. After the dry run everything works as
# expected.
#
# (Note: This code does the right thing if you do not use direct_output.)
# In the dry run we need an instruction with a
# sumfactorization node. We use this to decide on a
# vectorization strategy. This is just a dummy
# instruction, in the real run the accumulation is done
# directly in the sumfactorization.
if
get_global_context_value
(
"
dry_run
"
,
False
):
ft
=
get_global_context_value
(
"
form_type
"
)
if
ft
==
'
residual
'
or
ft
==
'
jacobian_apply
'
:
shape
=
(
basis_functions_per_direction
(),)
*
world_dimension
()
ftags
=
"
,
"
.
join
([
"
f
"
]
*
len
(
shape
))
globalarg
(
accum
,
dtype
=
np
.
float64
,
shape
=
shape
,
dim_tags
=
ftags
)
assignee
=
prim
.
Subscript
(
prim
.
Variable
(
accum
),
tuple
(
prim
.
Variable
(
i
)
for
i
in
inames
))
expression
=
prim
.
Sum
((
assignee
,
result
))
instruction
(
assignee
=
assignee
,
expression
=
expression
,
forced_iname_deps
=
frozenset
(
inames
),
forced_iname_deps_is_final
=
True
,
depends_on
=
insn_dep
,
)
else
:
assert
ft
==
'
jacobian
'
shape
=
(
basis_functions_per_direction
(),)
*
(
world_dimension
()
*
2
)
ftags
=
"
,
"
.
join
([
"
f
"
]
*
len
(
shape
))
globalarg
(
accum
,
dtype
=
np
.
float64
,
shape
=
shape
,
dim_tags
=
ftags
)
_test_inames
=
tuple
(
prim
.
Variable
(
i
)
for
i
in
inames
)
# TODO the next line should get its inames from elsewhere. This is *NOT* robust (but works right now)
_ansatz_inames
=
tuple
(
Variable
(
visitor
.
inames
[
i
])
for
i
in
range
(
world_dimension
()))
assignee
=
prim
.
Subscript
(
prim
.
Variable
(
accum
),
_ansatz_inames
+
_test_inames
)
expression
=
prim
.
Sum
((
assignee
,
result
))
instruction
(
assignee
=
assignee
,
expression
=
expression
,
forced_iname_deps
=
frozenset
(
inames
+
visitor
.
inames
),
forced_iname_deps_is_final
=
True
,
depends_on
=
insn_dep
,
)
dummy
=
"
dummy
"
globalarg
(
dummy
,
dtype
=
np
.
float64
)
instruction
(
assignee
=
prim
.
Variable
(
dummy
),
expression
=
result
,
forced_iname_deps
=
frozenset
(
inames
),
forced_iname_deps_is_final
=
True
,
depends_on
=
insn_dep
,
)
# Default: Generate accumulation instructions
else
:
expr
=
Call
(
PDELabAccumulationFunction
(
accum
,
rank
),
...
...
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