Skip to content

Output Celeritas diagnostics from within LArSoft - #2477

Draft
sethrj wants to merge 16 commits into
celeritas-project:developfrom
sethrj:larsoft-output
Draft

sethrj wants to merge 16 commits into
celeritas-project:developfrom
sethrj:larsoft-output

Conversation

@sethrj

@sethrj sethrj commented Sep 9, 2026

Copy link
Copy Markdown
Member

This is focused on the application front-ends and specifically larceler, but it changes the output registry to be more mutable and allows it to be "output" multiple times by appending to an existing file. In the larsoft case, the main diagnostics are written after the runner is set up as one line of NDJSON/JSONL, and then each event writes a subsequent line of output.

Changes:

  • FileOrConsole has flags for opening in "append" mode
  • Output registry has new methods to support clearing and writing with clobber/append
  • Optical transporter now uses "exchange" rather than "get" for timing/results, clearing after each call
  • To make timing easier, added a combined rvalue get-and-clear method to stopwatch that lets us do diagnostics_->time.setup = std::move(get_time_delta)();
  • Output file is created and written during setup, rather than in individual apps

@sethrj
sethrj requested review from amandalund and stognini and a balanced review from Copilot September 9, 2026 18:06
@sethrj sethrj added enhancement New feature or request app Application front ends labels Sep 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

It contains a compilation failure, cumulative counters, missing event records, and an output-file truncation regression.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds persistent JSONL diagnostics for optical simulation, especially LArSoft event processing.

Changes:

  • Adds append/truncate output registry support.
  • Resets and reports per-run optical diagnostics.
  • Writes LArSoft setup and event diagnostics.
File summaries
File Description
test/Test.cc Clarifies filename counter comparison.
test/larceler/LarStandaloneRunner.test.cc Enables output and validates photon results.
test/corecel/sys/Stopwatch.test.cc Tests reset-after-read timing.
test/corecel/io/OutputRegistry.test.cc Tests persistent JSONL output.
src/larceler/pdfullsimceler.fcl Changes output extension to JSONL.
src/larceler/LarStandaloneRunner.hh Stores diagnostics and registry state.
src/larceler/LarStandaloneRunner.cc Writes setup and per-event diagnostics.
src/larceler/detail/LarRunnerDiagnosticsIO.json.hh Serializes LAr diagnostics.
src/larceler/detail/LarRunnerDiagnostics.hh Defines LAr diagnostic data.
src/larceler/CMakeLists.txt Updates dependencies and module setup.
src/corecel/sys/Stopwatch.hh Adds get-and-reset operation.
src/corecel/io/OutputRegistry.hh Adds persistent output API.
src/corecel/io/OutputRegistry.cc Implements JSONL output management.
src/corecel/io/OutputInterface.cc Documents compact JSON output.
src/corecel/io/Logger.hh Updates MPI logging guidance.
src/corecel/io/FileOrConsole.hh Adds configurable output modes.
src/celeritas/user/ActionTimes.hh Adds timing reset API.
src/celeritas/user/ActionTimes.cc Implements timing reset.
src/celeritas/setup/Problem.cc Opens configured optical output.
src/celeritas/optical/Transporter.hh Adds exchange APIs.
src/celeritas/optical/Transporter.cc Resets returned timing data.
src/celeritas/optical/Runner.hh Exposes reset-on-read results.
src/celeritas/optical/Runner.cc Exchanges run diagnostics.
app/celer-optical/SimulationResult.json.hh Clarifies timing semantics.
app/celer-optical/celer-optical.cc Uses registry-managed output.
Review details

Suppressed comments (1)

src/larceler/LarStandaloneRunner.cc:91

  • output_reg is not declared in this scope, so profiling-enabled builds cannot compile this constructor. Invoke insert on the output_ member used immediately above.
            output_reg.insert(
  • Files reviewed: 25/25 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/corecel/io/FileOrConsole.hh
Comment thread src/celeritas/optical/Runner.cc Outdated
Comment thread src/larceler/LarStandaloneRunner.cc
Comment thread src/larceler/LarStandaloneRunner.cc
auto DuneCryoTest::make_input() -> Input
{
Input result;
result.problem.output_file = this->make_unique_filename("out.jsonl");
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Test summary

 5 421 files   8 846 suites   5m 57s ⏱️
 1 890 tests  1 877 ✅  13 💤 0 ❌
29 957 runs  29 794 ✅ 163 💤 0 ❌

Results for commit 613727b.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application front ends enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants