Skip to content

Commit

Permalink
Remove pickScheduler() that chooses GEDF when deadlines are present
Browse files Browse the repository at this point in the history
  • Loading branch information
lsk567 committed Nov 29, 2024
1 parent 5304960 commit 9bd8dac
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions core/src/main/java/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,31 +741,6 @@ else if (term.getParameter() != null)
return result.toString();
}

/** Set the scheduler type in the target config as needed. */
private void pickScheduler() {
// Don't use a scheduler that does not prioritize reactions based on deadlines
// if the program contains a deadline (handler). Use the GEDF_NP scheduler instead.
if (!targetConfig.get(SchedulerProperty.INSTANCE).prioritizesDeadline()) {
// Check if a deadline is assigned to any reaction
if (hasDeadlines(reactors)) {
if (!targetConfig.isSet(SchedulerProperty.INSTANCE)) {
SchedulerProperty.INSTANCE.override(targetConfig, Scheduler.GEDF_NP);
}
}
}
}

private boolean hasDeadlines(List<Reactor> reactors) {
for (Reactor reactor : reactors) {
for (Reaction reaction : allReactions(reactor)) {
if (reaction.getDeadline() != null) {
return true;
}
}
}
return false;
}

/**
* Copy all files or directories listed in the target property {@code files}, {@code
* cmake-include}, and {@code _fed_setup} into the src-gen folder of the main .lf file
Expand Down Expand Up @@ -2033,7 +2008,6 @@ protected boolean setUpGeneralParameters() {
CompileDefinitionsProperty.INSTANCE.update(targetConfig, Map.of("MODAL_REACTORS", "TRUE"));
}
if (!targetConfig.get(SingleThreadedProperty.INSTANCE)) {
pickScheduler();
CompileDefinitionsProperty.INSTANCE.update(
targetConfig,
Map.of(
Expand Down

0 comments on commit 9bd8dac

Please sign in to comment.