Repository navigation
Conversation
Output of a mean from sums over events, merged over MPI nodes before the mean is formed. The sums are not changed. Header total is the mean over all bins, marked mean: yes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes mean and error with MPI and on intermediate saves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Not for log of the signal and 2D with list, which are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Data without it is from an older version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
8d9eb73: data headers now always have Existing readers need no change. Tested on macOS, mostly against the same data with the marker removed:
Output still on the old paths says 🤖 Generated with Claude Code |
Free-form text area
Follow-up to / replacement for #3057. It keeps the idea from there (merge the raw sums over MPI nodes first, then form the mean), but does it once in the runtime instead of in each monitor.
The detector output treats all data as intensities. For a mean this gives wrong values or errors with MPI, wrong errors in serial, and wrong results after intermediate saves.
Runtime: new macros
DETECTOR_OUT_0D/1D/2D_MEAN, taking the sums over events of 1, w, w², w·v and w·v².Detector:line give the mean over all bins, instead of the sum of bins.mean: yesormean: no(ASCII line / NeXus attribute). Data without it is from an older version.Uses the macros / functions:
Pol_monitor,MeanPolLambda_monitor,PSD_Pol_monitor, andMonitor_nDwithsignal=(McStas and McXtrace). Manuals: both updated.Numerical changes (all monitors above; no change in ray-tracing or RNG use). Fully polarised beam, 10 000 rays, serial / 2 MPI nodes:
PSD_Pol_monitor, per binPol_monitorMeanPolLambda_monitor, per binMonitor_nD signal=lambdaHeader totals of 1D/2D means also change, e.g. 7.42 to 0.341 for
mediainHe3_spin_filter.Known limits
Monitor_nDwith log of the signal, and 2Dlistwithsignal=, keep the old path and saymean: no.PSD_monitor_coh(McXtrace) is not additive either, and is not touched. It also saysmean: no.Declaration of use of AI-tools
Co-Authored-Byline naming the tool, see CONTRIBUTING.mdDevelopment OS / boundary conditions
macOS arm64 (clang), plus Linux x86_64 in a container (gcc 14). No new dependencies.
Tested:
mctestof the 7 instruments using the polarisation monitors, serial and 2 MPI nodes: all pass. The non-mean detector totals are identical to main.mctest/mxtestofTest_Monitor_nD*andlibtestin both flavours: same detector totals as main.Test_Monitor_nD_list_MPIdid not link for McXtrace, on main too (NeXus library missing in my environment).USR2).signal=energy, serial and 2 MPI nodes.Not tested: Windows (MSVC), GPU/OpenACC, HTML manuals.
PR Checklist for contributing to McStas/McXtrace
My contribution includes patches to an existing component file
mcdocutility and rendered a reasonable documentation page for the component (component headers are not changed)mccode-clangformattool to apply the standard McCode component indentation schememcrun --c-lint"linter" and followed advice to remove most / all warnings that are raised (stopped after 3 minutes; a plaincppcheckgave no warnings in the new runtime code)My work touches / adds to the runtime lib code (.c,.h etc in multiple locations
mccode-ris in every instrument and has noTest_lib_of its own.Test_lib_monitor_nd_libexists in both flavours, but does not testsignal=. The mean output is run by the existing polarisation tests.🤖 Generated with Claude Code
Tip for reviewers: Visit https://blueblazin.github.io/blockviz/#github=https://github.com/mccode-dev/McCode/pull/3193 for a visual look at code changes