|
DiffEq - Modern C++ ODE Integration Library 1.0.0
High-performance C++ library for solving ODEs with async signal processing
|
Parallel execution decorator - adds batch processing to any integrator. More...
#include <parallel_decorator.hpp>


Public Member Functions | |
| ParallelDecorator (std::unique_ptr< AbstractIntegrator< S > > integrator, ParallelConfig config={}) | |
| Construct parallel decorator. | |
| template<typename StateRange > | |
| void | integrate_batch (StateRange &&states, typename IntegratorDecorator< S >::time_type dt, typename IntegratorDecorator< S >::time_type end_time) |
| Integrate multiple states in parallel. | |
| template<typename Generator , typename Processor > | |
| auto | integrate_monte_carlo (size_t num_simulations, Generator &&generator, Processor &&processor, typename IntegratorDecorator< S >::time_type dt, typename IntegratorDecorator< S >::time_type end_time) |
| Monte Carlo integration with parallel execution. | |
| template<typename StateRange > | |
| void | integrate_batch_chunked (StateRange &&states, typename IntegratorDecorator< S >::time_type dt, typename IntegratorDecorator< S >::time_type end_time) |
| Chunked parallel processing with load balancing. | |
| ParallelConfig & | config () |
| Access and modify parallel configuration. | |
| const ParallelConfig & | config () const |
| void | update_config (ParallelConfig new_config) |
| Update parallel configuration with validation. | |
| size_t | get_optimal_thread_count () const |
| Get optimal number of threads for current configuration. | |
Public Member Functions inherited from diffeq::core::composable::IntegratorDecorator< S > | |
| IntegratorDecorator (std::unique_ptr< base_type > integrator) | |
| Construct decorator wrapping another integrator. | |
| virtual | ~IntegratorDecorator ()=default |
| Virtual destructor for proper cleanup. | |
| void | step (state_type &state, time_type dt) override |
| void | integrate (state_type &state, time_type dt, time_type end_time) override |
| time_type | current_time () const override |
| void | set_time (time_type t) override |
| void | set_system (system_function sys) override |
| base_type & | wrapped () |
| Access to wrapped integrator for advanced use. | |
| const base_type & | wrapped () const |
| bool | has_wrapped_integrator () const |
| Check if wrapped integrator exists. | |
Public Member Functions inherited from diffeq::core::AbstractIntegrator< S > | |
| AbstractIntegrator (system_function sys) | |
| time_type | current_time () const |
| void | set_time (time_type t) |
| void | set_system (system_function sys) |
Additional Inherited Members | |
Public Types inherited from diffeq::core::composable::IntegratorDecorator< S > | |
| using | base_type = AbstractIntegrator< S > |
| using | state_type = typename base_type::state_type |
| using | time_type = typename base_type::time_type |
| using | system_function = typename base_type::system_function |
Public Types inherited from diffeq::core::AbstractIntegrator< S > | |
| using | state_type = S |
| using | time_type = typename S::value_type |
| using | value_type = typename S::value_type |
| using | system_function = std::function< void(time_type, const state_type &, state_type &)> |
Protected Member Functions inherited from diffeq::core::AbstractIntegrator< S > | |
| void | advance_time (time_type dt) |
Protected Attributes inherited from diffeq::core::composable::IntegratorDecorator< S > | |
| std::unique_ptr< base_type > | wrapped_integrator_ |
Protected Attributes inherited from diffeq::core::AbstractIntegrator< S > | |
| system_function | sys_ |
| time_type | current_time_ |
Parallel execution decorator - adds batch processing to any integrator.
This decorator provides parallel execution capabilities with the following features:
Key Design Principles:
Note: This decorator requires integrator factory support for thread-local copies.
Definition at line 75 of file parallel_decorator.hpp.
|
inlineexplicit |
Construct parallel decorator.
| integrator | The integrator to wrap |
| config | Parallel configuration (validated on construction) |
| std::invalid_argument | if config is invalid |
Definition at line 86 of file parallel_decorator.hpp.
|
inline |
Access and modify parallel configuration.
Definition at line 267 of file parallel_decorator.hpp.
|
inline |
Definition at line 268 of file parallel_decorator.hpp.
|
inline |
Get optimal number of threads for current configuration.
Definition at line 283 of file parallel_decorator.hpp.
|
inline |
Integrate multiple states in parallel.
| StateRange | Range type containing states to integrate |
| states | Range of states to integrate |
| dt | Time step |
| end_time | Final integration time |
| std::runtime_error | if integrator copying is not implemented |
Definition at line 110 of file parallel_decorator.hpp.

|
inline |
Chunked parallel processing with load balancing.
| StateRange | Range type containing states |
| states | Range of states to integrate |
| dt | Time step |
| end_time | Final integration time |
Definition at line 223 of file parallel_decorator.hpp.

|
inline |
Monte Carlo integration with parallel execution.
| Generator | Function that generates initial states: state_type(size_t) |
| Processor | Function that processes final states: result_type(const state_type&) |
| num_simulations | Number of Monte Carlo simulations |
| generator | Function to generate initial states |
| processor | Function to process final states |
| dt | Time step |
| end_time | Final integration time |
| std::runtime_error | if integrator copying is not implemented |
Definition at line 163 of file parallel_decorator.hpp.
|
inline |
Update parallel configuration with validation.
| new_config | New configuration |
| std::invalid_argument | if new config is invalid |
Definition at line 275 of file parallel_decorator.hpp.
