Skip to content

Commit

Permalink
Merge pull request #282 from lf-lang/remove-deprecated-scheds
Browse files Browse the repository at this point in the history
Fix GEDF_NP and remove deprecated schedulers
  • Loading branch information
erlingrj authored Oct 6, 2023
2 parents 76d1562 + eefa45a commit 5bbdefd
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 1,249 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ jobs:
compiler-ref: ${{ needs.fetch-lf.outputs.ref }}
scheduler: GEDF_NP

lf-gedf-np-ci:
needs: fetch-lf
uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master
with:
runtime-ref: ${{ github.ref }}
compiler-ref: ${{ needs.fetch-lf.outputs.ref }}
scheduler: GEDF_NP_CI

lf-adaptive:
needs: fetch-lf
uses: lf-lang/lingua-franca/.github/workflows/c-tests.yml@master
Expand Down
2 changes: 0 additions & 2 deletions core/threaded/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ set(
THREADED_SOURCES
reactor_threaded.c
scheduler_adaptive.c
scheduler_GEDF_NP_CI.c
scheduler_GEDF_NP.c
scheduler_NP.c
scheduler_PEDF_NP.c
scheduler_sync_tag_advance.c
scheduler_instance.c
watchdog.c
Expand Down
14 changes: 8 additions & 6 deletions core/threaded/scheduler_GEDF_NP.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @author{Marten Lohstroh <marten@berkeley.edu>}
*/
#include "lf_types.h"
#if SCHEDULER == GEDF_NP
#if SCHEDULER == SCHED_GEDF_NP
#ifndef NUMBER_OF_WORKERS
#define NUMBER_OF_WORKERS 1
#endif // NUMBER_OF_WORKERS
Expand Down Expand Up @@ -87,15 +87,17 @@ int _lf_sched_distribute_ready_reactions(lf_scheduler_t* scheduler) {
// Note: All the threads are idle, which means that they are done inserting
// reactions. Therefore, the reaction queues can be accessed without locking
// a mutex.
for (; scheduler->next_reaction_level <=
scheduler->max_reaction_level;
try_advance_level(scheduler->env, &scheduler->next_reaction_level)) {

while (scheduler->next_reaction_level <= scheduler->max_reaction_level) {
LF_PRINT_DEBUG("Waiting with curr_reaction_level %zu.", scheduler->next_reaction_level);
try_advance_level(scheduler->env, &scheduler->next_reaction_level);

tmp_queue = ((pqueue_t**)scheduler->triggered_reactions)
[scheduler->next_reaction_level];
[scheduler->next_reaction_level-1];
size_t reactions_to_execute = pqueue_size(tmp_queue);

if (reactions_to_execute) {
scheduler->executing_reactions = tmp_queue;
scheduler->next_reaction_level++;
return reactions_to_execute;
}
}
Expand Down
Loading

0 comments on commit 5bbdefd

Please # to comment.