MUMPS ICNTL(14)=200 in the default direct solver parameters never reaches MUMPS
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
firedrake/petsc.py の _DEFAULT_DIRECT_SOLVER_PARAMETERS と _DEFAULT_KSP_PARAMETERS 付近から始め、次に提供されている MUMPS 再現プログラムを -options_left 付きで実行します。デフォルト値が ICNTL(14)=200 として MUMPS に渡り、対応する未使用の PETSc オプションが報告されなければ、修正は完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The default direct-solver parameters set ICNTL(14) = 200 for MUMPS, but the option never reaches MUMPS: it is composed into pc_factor_mat_mumps_icntl_14, which PETSc reports as an unused option. MUMPS therefore runs with its own default ICNTL(14) = 20.
This silently removes the intended 200% working-space relaxation, making INFOG(1) = -9 ("main internal real/complex workarray too small") more likely on problems with significant extra fill-in — which is exactly the failure mode the default was added to protect against.
Steps to Reproduce
from firedrake import *
from firedrake.petsc import PETSc
mesh = UnitSquareMesh(8, 8)
V = FunctionSpace(mesh, "CG", 1)
u, v = TrialFunction(V), TestFunction(V)
uh = Function(V)
problem = LinearVariationalProblem(
inner(grad(u), grad(v))*dx, inner(Constant(1), v)*dx,
uh, bcs=DirichletBC(V, 0, "on_boundary"))
solver = LinearVariationalSolver(problem) # defaults only
print("solver.parameters:", dict(solver.parameters))
prefix = solver.snes.getOptionsPrefix() or ""
pc = solver.snes.getKSP().getPC()
# ask MUMPS to print its own ICNTL table
PETSc.Options().setValue(prefix + "mat_mumps_icntl_4", "2")
solver.solve()
print("factor Mat prefix:", repr(pc.getFactorMatrix().getOptionsPrefix()))
Run with -options_left:
python3 mwe.py -options_left
Expected behavior
MUMPS reports ICNTL(14) = 200.
Actual behavior
solver.parameters: {'mat_type': 'aij', 'ksp_type': 'preonly', 'ksp_rtol': 1e-07,
'pc_type': 'lu', 'pc_factor_mat_solver_type': 'mumps',
'pc_factor_mat_mumps_icntl_14': 200, 'snes_type': 'ksponly'}
snes prefix: 'firedrake_1_'
factor Mat prefix: 'firedrake_1_'
ICNTL(14) Percentage of memory relaxation = 20
ICNTL(14) Memory relaxation = 20
Unused PETSc option: firedrake_1_pc_factor_mat_mumps_icntl_14
Analysis
The value itself is set with the correct key in _DEFAULT_DIRECT_SOLVER_PARAMETERS:
https://github.com/firedrakeproject/firedrake/blob/main/firedrake/petsc.py#L120-L122
if DEFAULT_DIRECT_SOLVER == "mumps":
_DEFAULT_DIRECT_SOLVER_PARAMETERS["mat_mumps_icntl_14"] = 200
but that whole dict is then nested under a "pc_factor" key and flattened:
https://github.com/firedrakeproject/firedrake/blob/main/firedrake/petsc.py#L137-L143
_DEFAULT_KSP_PARAMETERS = petsctools.flatten_parameters({
"mat_type": "aij",
"ksp_type": "preonly",
"ksp_rtol": 1e-7,
"pc_type": "lu",
"pc_factor": _DEFAULT_DIRECT_SOLVER_PARAMETERS
})
so {"pc_factor": {"mat_mumps_icntl_14": 200}} becomes pc_factor_mat_mumps_icntl_14.
The pc_factor_ nesting is right for mat_solver_type (pc_factor_mat_solver_type is a genuine PCFactor option and does take effect), but MUMPS ICNTL options are not in the PCFactor namespace — they belong to the factored Mat, whose options prefix is just the solver prefix (firedrake_1_ above, with no pc_factor_ segment). The factored matrix looks for <prefix>mat_mumps_icntl_14, so the composed key can never match.
Consistent with that, putting the key at the top level does work:
solver_parameters = {"ksp_type": "preonly", "pc_type": "lu",
"pc_factor_mat_solver_type": "mumps",
"mat_mumps_icntl_14": 77,
"mat_mumps_icntl_4": 2}
# -> ICNTL(14) Percentage of memory relaxation = 77
So the two kinds of options in _DEFAULT_DIRECT_SOLVER_PARAMETERS need different prefixes and cannot be flattened under a single "pc_factor" key.
This is related to, but distinct from, #2250 (user-supplied mg_coarse_mat_mumps_icntl_XX ignored in the multigrid coarse solver): that one is about propagating user options into a sub-solver, whereas this is Firedrake's own default silently not applying.
Environment
- Firedrake 2026.4.1
- PETSc 3.25
- MUMPS 5.8.2
- macOS (arm64)
Verified against main at the time of writing: firedrake/petsc.py lines 122 and 137–143 are unchanged from the installed version.
- 主要言語
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
alltheplaces/alltheplaces#20570 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
area:ci bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
catincloud-labs/dagster-dex#206 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
number_to_words raises ValueError with threshold= for ordinals ("12th") and comma-grouped strings ("1,000")対応中かも @hemtilva が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
providers security
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
agentbreeder/agentbreeder#1031 ·
メンテナーはふだん 1 日以内に返信