Skip to content

[turborvb] 新規パッケージ追加(#155 候補: 第一原理 QMC ソルバー) - #199

Open
k-yoshimi wants to merge 2 commits into
developfrom
feat/155-turborvb
Open

[turborvb] 新規パッケージ追加(#155 候補: 第一原理 QMC ソルバー)#199
k-yoshimi wants to merge 2 commits into
developfrom
feat/155-turborvb

Conversation

@k-yoshimi

Copy link
Copy Markdown
Collaborator

概要

#155(2024年度追加候補)の TurboRVB(第一原理量子モンテカルロ・ソルバー, v1.0.0)を新規パッケージとして追加します。mvmc / tenes と同じ CMake アプリのテンプレートに従っています。TurboGenius(#198)が必要とする本体です。

ビルド構成(serial + MPI フル)

  • out-of-source の CMake ビルド(≥3.20)。既定オプション(EXT_SERIAL=ON, EXT_PARALLEL=ON、QMC + DFT + tools)。
  • Fortran/C コンパイラと BLAS/LAPACK を自動検出(Intel MKL があれば利用)。MPI は find_package(MPI) で検出し、無ければ CMake が並列版を自動的に外す。ScaLAPACK は見つかればリンク。
  • CC / FC / CMAKE / MA_EXTRA_FLAGS / MAKE_J を config.txt で受け取る。フルビルドには MPI Fortran コンパイラが必要。
  • インストールされる主なバイナリ: QMC エンジン turborvb-serial.x / turborvb-mpi.x、DFT prep prep-serial.x / prep-mpi.x、ツール makefort10.x / readalles.x など。
  • スモークテストは主要バイナリの導入を確認。

TurboGenius 連携

turborvbvars.sh は(root 変数名がそのまま)TURBORVB_ROOT を export します。TurboGenius(#198)は import 時に TURBORVB_ROOT を参照するため、turbogeniusvars.sh より先に turborvbvars.sh を source すれば TurboGenius がこの TurboRVB を利用します。v1.0.0 は一部ツールを -serial 付きで命名するため、必要に応じ TURBO*_RUN_COMMAND で上書き可能(README に明記)。

検証方針(重要)

ohtaka は 2026-07-14 09:00 まで保守期間中(全計算ノードが予約 202607.M で確保)で、計算ノードでの実機ビルドは保守明けに実施予定です。それまでは GitHub Actions(ubuntu, gfortran + openmpi + lapack/scalapack)でクリーンルーム・ビルド検証を回します(本 PR の CI)。CI が通ることを確認後、ohtaka の Intel oneAPI + i8cpu(インタラクティブ)での実機ビルドを追記します。

  • CI 用に per-app override .github/scripts/turborvb.shMAKE_J=-j4)を追加。
  • en/ja Sphinx appendix に登録(MateriApps en app/2919 / ja app/2786、GPLv3)。

🤖 Generated with Claude Code

Add apps/turborvb for TurboRVB v1.0.0, following the mvmc/tenes CMake app
template. Build specifics:

- out-of-source CMake build (>=3.20) with the default options
  (EXT_SERIAL=ON, EXT_PARALLEL=ON, QMC + DFT + tools); auto-detects the
  Fortran/C compiler and BLAS/LAPACK (Intel MKL when available), finds MPI
  with find_package(MPI) and links ScaLAPACK when found
- captures CC/FC/CMAKE/MA_EXTRA_FLAGS/MAKE_J via config.txt; the full build
  requires an MPI Fortran compiler for the parallel executables
- installs the QMC engine (turborvb-serial.x, turborvb-mpi.x), DFT prep
  (prep-serial.x, prep-mpi.x) and tools (makefort10.x, readalles.x, ...)
- turborvbvars.sh exports TURBORVB_ROOT (the root variable name), which the
  turbogenius wrapper reads at import time; README documents the pairing
- smoke test asserts the core executables were installed
- CI: add to the app matrix with a per-app override (MAKE_J=-j4); register
  in the en/ja Sphinx appendix

Note: ohtaka is in scheduled maintenance until 2026-07-14; CI (ubuntu,
gfortran + openmpi + lapack/scalapack) validates the clean-room build now,
and the ohtaka Intel-oneAPI compute-node run will be added after maintenance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaWKJsSQqCakkMEKZpJcvP
- install.sh: export CC/FC in config.txt instead of the tenes-inherited CXX
  (TurboRVB is Fortran+C; this restores the compiler-override contract)
- test.sh: split the executable check so serial binaries are always required
  and a missing turborvb-mpi.x gives an explicit "MPI not found" diagnostic
  (the full default build requires MPI, so it stays a hard failure)
- README: drop the fragile ../turbogenius relative link (plain text instead)
  and use US spelling

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaWKJsSQqCakkMEKZpJcvP
@k-yoshimi

Copy link
Copy Markdown
Collaborator Author

AI レビューサイクル結果(Codex + Antigravity)

CI(クリーンルーム・ビルド検証)

ubuntu-24.04 / ubuntu-22.04 の両 turborvb ジョブが成功。configure → build(make -j4)→ install → runtest(バイナリ存在チェック)が gfortran + openmpi + reference lapack/scalapack で通ることを確認。想定したバイナリ名(turborvb-serial.x/-mpi.x, prep-serial.x, makefort10.x, readalles.x)が正しいことも実証されました。

Phase 1 — Codex(コード correctness)

  • must_fix(1件, 対応済み): install.sh の config.txt が tenes 由来で CXX(C++)を export していた。TurboRVB は Fortran+C なので、mvmc に合わせて CC / FC を export するよう修正(コンパイラ上書きの契約を回復)。CI が gfortran 自動検出で通っていたのはこのためで、ユーザ指定コンパイラが config.txt に記録されない不具合でした。
  • optional(test の MPI チェック): 下記 Antigravity と同旨。フルビルド契約として意図的にハード失敗のまま、メッセージを明確化。

Phase 2 — Antigravity(ドキュメント / ワークフロー)

  • must_fix_docs: なし
  • should_fix / workflow_risk(対応済み):
    • README の ../turbogenius 相対リンクが [turbogenius] 新規パッケージ追加(#155 候補: TurboRVB の Python ラッパー, ohtaka 検証済み) #198 マージ前は壊れる(マージ順依存)→ リンクをやめ apps/turbogenius の平文に変更。
    • test.shturborvb-mpi.x 無条件チェック → シリアルバイナリは常時必須、MPI バイナリ欠如時は「MPI が見つからなかった」旨の明示メッセージを出して失敗するよう改善(ユーザ選択のフル serial+MPI ビルドを検証する意図のためハード失敗は維持)。
    • 英スペル honourshonors

検証方針

ohtaka は 2026-07-14 09:00 まで保守中のため、本 PR は CI(ubuntu クリーンルーム)で検証済み。保守明けに ohtaka の Intel oneAPI + i8cpu での実機ビルドを追記します。

Codex の must_fix・Antigravity の must_fix_docs はいずれも対応済み(残指摘も理由付きで対応)。CI 再実行の結果を確認のうえ収束とします。

k-yoshimi added a commit that referenced this pull request Jul 9, 2026
…inaries

Holistic cross-PR review (turbogenius #198 vs turborvb #199) flagged that
turbogeniusvars.sh defaulted TURBORVB_ROOT to the bare $MA_ROOT/turborvb
parent, so sourcing turbogeniusvars.sh alone let `import turbogenius` succeed
but deferred a confusing failure to QMC run time (the real binaries live in
the versioned $MA_ROOT/turborvb/turborvb-<ver>-<rev> that turborvbvars.sh
exports).

Resolve TURBORVB_ROOT in order: existing value -> the installed turborvb
package's turborvbvars.sh (auto-sourced, gives the versioned path with the
binaries) -> bare $MA_ROOT/turborvb (import-only fallback). Installing the
turborvb package first is now sufficient; no source-ordering to remember.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaWKJsSQqCakkMEKZpJcvP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants