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

Sizing utilities

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.CUDAFactory and numba.cuda.

  • Loop buffers and output slices align with expectations from cubie.integrators.loops and related algorithm factories.