SingleIntegratorRun

class cubie.integrators.SingleIntegratorRun(system: BaseODE, drivers_fn: Callable | None = None, driver_derivative_fn: Callable | None = None, **settings: Any)[source]

Bases: SingleIntegratorRunCore

Expose aggregated read-only properties for integrator runs.

Notes

Instantiation, updates, and compilation are provided by SingleIntegratorRunCore. This subclass intentionally limits itself to property-based access so that front-end utilities can inspect compiled CUDA components without mutating internal state.

_regular_event_count(duration: float, interval: float) int[source]

Count how many scheduled events fit inside a duration.

Casting duration and interval to the working precision rounds each of them slightly, so the division can land just below a whole number when the user asked for a whole number of events: float32 turns 10.0 / 0.001 into 9999.9993, which would floor to 9999 and lose the event at the end time. A small allowance is added before flooring so a result this close to a whole number counts as that whole number.

The allowance covers only the one-off rounding of the two cast values. The allocation and the device’s event counts both come from this count, so the host and the device always agree with each other; see save_event_count() and summary_sample_count().

Parameters:
  • duration – Integration duration in time units.

  • interval – Scheduling interval in time units.

Returns:

Number of scheduled events, excluding the initial sample.

Return type:

int

property algorithm: str

Return the configured algorithm identifier.

property atol: Any | None

Return the absolute tolerance array.

property compile_flags: Any

Return loop compile flags.

property dt: float | None

Return the fixed step size for fixed controllers.

property dt_max: float

Return the maximum allowable step size.

property dt_min: float

Return the minimum allowable step size.

property dxdt_fn: Callable

Return the derivative function used by the integration step.

property is_adaptive: bool

Return whether adaptive stepping is active.

property output_array_heights: Any

Return the output array height descriptor.

property output_compile_flags: Any

Return the output compile flags.

output_length(duration: float) int[source]

Calculate number of time-domain output samples for a duration.

Parameters:

duration – Integration duration in time units.

Returns:

Number of output samples including initial and optionally final.

Return type:

int

property output_types: Any

Return the configured output types.

property persistent_local_elements: int

Return total persistent local-memory elements required by the loop.

property rtol: Any | None

Return the relative tolerance array.

property sample_summaries_every: float | None

Return the loop sample summaries interval, or None if not configured.

property save_counters: bool

Return whether iteration-counter saving is enabled.

save_event_count(duration: float) int[source]

Return the number of scheduled save rows, initial included.

property save_every: float | None

Return the loop save interval, or None if not configured.

property save_last: bool

Return True if end-of-run-only state saving is configured.

property save_state_fn: Callable

Return the compiled state saving function.

property save_summaries_fn: Callable

Return the compiled summary saving function.

property save_time: bool

Return whether time saving is enabled.

property saved_observable_indices: Any

Return the saved observable indices.

property saved_state_indices: Any

Return the saved state indices.

property shared_memory_bytes: int

Return total shared-memory usage in bytes.

property shared_memory_elements: int

Return total shared-memory elements required by the loop.

property solver_diagnostics: Dict[str, Any]

Return the step’s solver settings reported when runs fail.

property step_controller: str

Return the configured step-controller identifier.

summaries_length(duration: float) int[source]

Calculate number of summary output rows for a duration.

The device writes one summary row after every samples_per_summary summary measurements. The number of measurements in a run follows the same counting rule as saves (_regular_event_count()), and only a complete window produces a row, so the row count is the measurement count divided by the measurements per window, rounded down. The measurements-per-window value is read from the loop configuration, the same place the device code gets it.

Parameters:

duration – Integration duration in time units.

Returns:

Number of summary rows.

Return type:

int

property summarise_every: float | None

Return the loop summary interval, or None if not configured.

property summarised_observable_indices: Any

Return the summarised observable indices.

property summarised_state_indices: Any

Return the summarised state indices.

property summary_legend_per_variable: Any

Return the summary legend per variable.

summary_sample_count(duration: float) int[source]

Return the number of scheduled summary samples.

property summary_unit_modifications: Any

Return the summary unit modifications.

property system: BaseODE

Return the underlying ODE system.

property system_sizes: SystemSizes

Return the size descriptor for the ODE system.

property threads_per_step: int

Return the number of threads required by the step function.

property update_summaries_fn: Callable

Return the compiled summary update function.