-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adaptive scheduler for C target #1207
Conversation
11c7278
to
880734f
Compare
It looks like the Windows tests are failing because of a path-related issue: A required target resource could not be found: /lib/c/reactor-c/core/threaded\scheduler_NP.c |
880734f
to
8575800
Compare
61ef088
to
36c2e76
Compare
9d25354
to
9969d5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for cleaning up the logic in the validator.
@@ -112,13 +115,16 @@ private static List<String> getThreadSupportFiles( | |||
SchedulerOption scheduler | |||
) { | |||
return threading ? | |||
List.of( | |||
Stream.concat( | |||
Stream.of( | |||
"threaded/scheduler.h", | |||
"threaded/scheduler_instance.h", | |||
"threaded/scheduler_sync_tag_advance.c", | |||
"threaded/scheduler_" + scheduler + ".c", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line seems to not be necessary for the adaptive
scheduler since scheduler.getRelativePaths()
already includes this. Would it make sense to have all these files added in the enum constructor for all schedulers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch... I'll fix that. The other three files -- scheduler.h
, scheduler_instance.h
, and scheduler_sync_tag_advance.c
-- are currently used by all schedulers, I think, so to me it seems reasonable to limit redundancy by keeping them here.
(BTW, I have for a while been making noises about factoring this logic out into CMake files, so if others agree with me then this code might not be here for long anyway.)
Edit: The adaptive scheduler doesn't use scheduler_instance.h
, actually, but I think it's harmless to copy it into the src-gen
directory. I don't think doing so has any effect on the executable produced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factoring this logic out into CMake files
This sounds like a great idea. Are you imagining each scheduler having a separate CMakeLists.txt
or one CMakeLists.txt
for all the schedulers?
One thing to keep in mind is that we should still be able to accommodate cmake: false
(i.e., building without CMake).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How important is it to accommodate cmake: false
? Maybe this isn't the place to have this discussion, but I am not aware of use-cases for cmake: false
, and what I was talking about was basically to do away with it. Do we maintain it just for fun?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s for embedded systems, particularly bare-iron, that don’t necessarily have a supported CMake-based workflow.
To clarify -- this is the scheduler that previously had the vague name "heuristic."
This scheduler is written in response to poor scaling behavior wrt number of threads in our Savina benchmarks. It achieves good performance on these benchmarks, but it is uncertain whether this good performance will generalize beyond them.
Some notes: