Closed petervdonovan closed 4 months ago
The changes involve adjustments to the control flow and type handling within two core files: reactor_common.c
and scheduler_adaptive.c
. In reactor_common.c
, the order of function calls within the termination
function has been updated for cleaner reactor cleanup. Meanwhile, scheduler_adaptive.c
improvements include type casting for assertions, pointer arithmetic adjustments, and introducing a new variable for better control over level advancement based on reaction counts.
File | Change Summary |
---|---|
core/reactor_common.c |
Relocated the call to lf_tracing_global_shutdown() after reactor cleanup within the termination function. |
core/threaded/scheduler_adaptive.c |
Adjusted type casting in assertions, pointer arithmetic in get_reaction function, and added total_num_reactions variable for controlling level advancement. |
sequenceDiagram
participant Reactor
participant Tracing as lf_tracing_global_shutdown()
note over Reactor: Old Flow
Reactor->>+Tracing: Initiate Shutdown
Reactor->>Reactor: Cleanup Reactors
Reactor-->>-Tracing: Complete
note over Reactor: New Flow
Reactor->>Reactor: Cleanup Reactors
Reactor->>+Tracing: Initiate Shutdown
Reactor-->>-Tracing: Complete
This diagram outlines the changes in the control flow for the termination
function in reactor_common.c
, illustrating how the reactor cleanup now occurs before the call to lf_tracing_global_shutdown()
.
[!TIP]
AI model upgrade
## `gpt-4o` model for reviews and chat is now live OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide any feedback or to report any issues.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
As a reminder, the adaptive scheduler is a scheduler that, at least when it was created, either matched or outperformed our other schedulers in our benchmarks. Maybe we have too many schedulers, and maybe we should remove it, but this is the reason why we have it in our code base. See the graph here; the green line labeled "C heuristic" is the adaptive scheduler.
This fixes two serious bugs in the adaptive scheduler. In one bug, casting and pointer arithmetic are done in the wrong order. In the other bug, the level is advanced even if, in the process of waiting for the level to be ready to advance, more reactions were injected onto the reaction queue.
It seems like the adaptive scheduler may not have kept up with updates to federated execution in the past year.
Summary by CodeRabbit
Bug Fixes
Refactor