BUG: Parallel assembly of expressions involving SpatialCoordinates, on submeshes, can give the wrong answer
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
Issue 内の inline Python MFE から始め、それをシリアル実行および 8 コアで実行して、qty_1 と qty_2 の異なる値を再現します。parent の SpatialCoordinates と submesh の SpatialCoordinates のどちらを使用するかによる、forms の並列 submesh アセンブリを追跡します。シリアル実行時と同様に、並列実行時にも両方の量が一致すれば完了です。レポートではリポジトリのファイルやテストを挙げません。
索引モデルが issue の本文から書いたものです。
説明
There seems to be a bug where submesh assembly is not done correctly in parallel. See the MFE below.
I compute two quantities, qty_1 and qty_2, by assembling two UFL forms over the submesh. The UFL forms are the same, but for qty_1 it uses the parent SpatialCoordinates, and for qty_2 the submesh SpatialCoordinates.
In serial this gives the same answer, the script output is: qty_1 is 2.83297e+00, qty_2 is 2.83297e+00
In parallel (8 cores) it gives: qty_1 is 2.61235e+00, qty_2 is 2.83297e+00
So it seems that assembling parent mesh SpatialCoordinates may be bugged in parallel.
MFE:
from firedrake import *
# Create the unlabelled mesh (unit square)
mesh = UnitSquareMesh(4, 4)
x_sc, y_sc = SpatialCoordinate(mesh)
# Label the mesh, creating the left-half, right-half and interface
DG0 = FunctionSpace(mesh, "DG", 0)
DGT0 = FunctionSpace(mesh, "DGT", 0)
tag_L = Function(DG0).interpolate(conditional(lt(x_sc, 0.5), 1, 0)) # Left-half, of dimension 2
tag_R = Function(DG0).interpolate(conditional(gt(x_sc, 0.5), 1, 0)) # Right-half, of dimension 2
tag_G = Function(DGT0).interpolate(conditional(lt(abs(x_sc - 0.5), 1.0e-8), 1, 0)) # Interface, of dimension 1
label_L = 1
label_R = 2
label_G = 3
mesh = RelabeledMesh(mesh, [tag_L, tag_R, tag_G], [label_L, label_R, label_G])
x_sc, y_sc = SpatialCoordinate(mesh)
# Create the submeshes
mesh_L = Submesh(mesh, 2, label_L) # Left-half mesh, of dimension 2
mesh_R = Submesh(mesh, 2, label_R) # Right-half mesh, of dimension 2
mesh_G = Submesh(mesh, 1, label_G) # Interface mesh, of dimension 1
# Create the measure on the interface
metadata = {"quadrature_degree": 15}
ds_G = Measure("dx", domain=mesh_G, intersect_measures=[ds(mesh_L), ds(mesh_R), dx(domain=mesh)], metadata=metadata)
# Create a UFL expression using the parent SpatialCoordinates
ufl_expr_1 = exp(x_sc + y_sc)
# Same expression, replacing the parent SpatialCoordinates with the interface SpatialCoordinates
ufl_expr_2 = replace(ufl_expr_1, {SpatialCoordinate(mesh) : SpatialCoordinate(mesh_G)})
# Integrate over the interface, and print the result
qty_1 = assemble(ufl_expr_1 * ds_G)
qty_2 = assemble(ufl_expr_2 * ds_G)
PETSc.Sys.Print("qty_1 is %.5e, qty_2 is %.5e" % (qty_1, qty_2))
# Running in parallel (8 cores) gives: qty_1 is 2.61235e+00, qty_2 is 2.83297e+00
# Running in serial gives: qty_1 is 2.83297e+00, qty_2 is 2.83297e+00
- 主要言語
- Python
- スター
- 684
- フォーク
- 204
- 平均マージ
- 4日 14時間
- マージ済み PR(30日)
- 46
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firedrakeproject/firedrake のほかの issue
-
BUG: NonlinearVariationalSolver errors with adj_kwargs対応中かも @dham が 151 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
firedrakeproject/firedrake#5186 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
firedrakeproject/firedrake#5091 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
firedrakeproject/firedrake#3556 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
firedrakeproject/firedrake#5644 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Function.assign on a subset fails with a Constant, a Real Function or abs in the expression対応中かも @connorjward が 2 日前に担当しました。 オープン
firedrakeproject/firedrake#5643 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
firedrakeproject/firedrake の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
datamodel-code-generator/datamodel-code-generator#6906 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
UKGovernmentBEIS/optstop#12 ·
-
bug good first issue severity: low
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
TMHSDigital/Awesome-Ads#37 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
smokin-salmon/smoked-salmon#1095 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Sienna-Platform/SiennaSchemas#130 ·
メンテナーはふだん 3 日以内に返信