Output handling
cubie.outputhandling
The output handling package manages CUDA device callbacks that save state trajectories and summary calculations from integration loops. It turns loop settings into checked configuration, builds the device functions through the CUDA factory tools, and provides sizing helpers so callers can allocate host and device buffers without repeating dimension logic.
Subpackages
Entry point
OutputFunctions is the main interface. Create it with loop
dimensions and requested outputs to compile CUDA functions that save solver
state, refresh summary metrics, and write reductions back to host arrays. The
factory keeps an OutputConfig instance and rebuilds compiled callbacks
when configuration changes.
Configuration
OutputConfig – attrs container describing requested outputs and summaries.
OutputCompileFlags – compile-time flags for CUDA output kernels.
Sizing utilities
SummariesBufferSizes – computes summary buffer dimensions.
LoopBufferSizes – describes per-loop buffer heights and widths.
OutputArrayHeights – calculates height metadata for output arrays.
SingleRunOutputSizes – shapes for single-run solver outputs.
BatchInputSizes – input buffer sizes for batch runs.
BatchOutputSizes – output buffer sizes for batch runs.
Runtime factories and registries
OutputFunctions – compiles CUDA callbacks for saving state and summaries.
OutputFunctionCache – caches compiled device callables keyed by configuration.
summary_metrics – shared registry of registered summary metrics.
register_metric – decorator used by metric implementations to register with the shared registry.
Dependencies
Compiles CUDA callables through
cubie.CUDAFactoryandnumba.cuda.Loop buffers and output slices align with expectations from
cubie.integrators.loopsand related algorithm factories.