Repo - REFACTOR - Write every run and replay output into one gpec.h5 file

Aperta
#643 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Ambito
data

Direzione di ricerca

Start in src/Rerun.jl at build_inputs_from_h5, which writes the _forcing.h5, _tolerances.toml, _kinetic.h5 and _wall.dat side files, then trace preloaded_coil_sets to see how in-memory data is passed to a run. The Grad-Shafranov side files come from src/Equilibrium/Axisymmetric/GradShafranovResidual.jl, and src/Analysis/Equilibrium.jl reads them back. Done when a test runs a deck and its replay, each into an empty directory, and each leaves exactly one file behind; docs/src/workflow.md should also stop listing side files.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A deck run should write exactly one file, gpec.h5, and a replay of a gpec.h5 should write exactly one file, <stem>_rerun.h5. Two code paths still write extra files:

Replay side files. build_inputs_from_h5 (src/Rerun.jl) turns the stored snapshot back into a deck that reads its inputs from files. So, for each input the source run had, it writes a file next to the rerun output:

  • <stem>_forcing.h5 (the forcing spectrum, Input/RawInputs/ForcingTerms);
  • <stem>_tolerances.toml (Input/RawInputs/ErrorFields/tolerance_toml_raw);
  • <stem>_kinetic.h5 (Input/RawInputs/Kinetic);
  • <stem>_wall.dat (Input/RawInputs/Wall/wall_file_raw).

Grad-Shafranov residual diagnostics. With [Equilibrium] diagnose_src = true, src/Equilibrium/Axisymmetric/GradShafranovResidual.jl writes gsec.h5, gse.h5 and gsei.h5 into the directory of the equilibrium file (dirname(eq_filename)). That is the user's input directory, not the run directory. src/Analysis/Equilibrium.jl reads gse.h5 and gsei.h5 from next to the output file, so the plot works only when the two directories are the same.

Proposed approach

  • Kinetic profiles: no side file is needed. The deck already accepts kinetic_group, so the replay can point kinetic_file at the source gpec.h5 with kinetic_group = "Input/RawInputs/Kinetic".
  • Forcing, tolerances and wall: hand the snapshot data to the run in memory, as preloaded_coil_sets already does for coil geometry.
  • Grad-Shafranov residual: write it into gpec.h5, under the Equilibrium/ group, following the HDF5 conventions. Point Analysis.Equilibrium at the new datasets.

Done when

  • A test runs a deck and replays its output, and checks that each wrote exactly one file into an otherwise empty directory.
  • diagnose_src = true writes nothing outside gpec.h5, and its plot reads from gpec.h5.
  • The "Replaying a run" section of docs/src/workflow.md no longer lists side files.
Lingua principale
Julia
Stelle
11
Fork
7
Merge medio
4g 3h
PR unite (30g)
70

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenFUSIONToolkit/GPEC

Tutte le issue di OpenFUSIONToolkit/GPEC

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.