Skip to content
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

GEDF scheduler deadlocks on some systems with decentralized coordination #474

Open
edwardalee opened this issue Aug 2, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@edwardalee
Copy link
Contributor

The following example, which is identical to the one in issue #473 except that it specifies the GEDF_NP scheduler, deadlocks:

target C {
  coordination: decentralized,
  scheduler: GEDF_NP,
}
reactor Pi {
  input trigger: bool
  output out: int
  reaction(trigger) -> out {=
    tag_t now = lf_tag();
    lf_print("***** at tag " PRINTF_TAG, now.time - lf_time_start(), now.microstep);
    lf_set(out, 42);
  =} STP (30 s) {=
    tag_t now = lf_tag();
    lf_print_error_and_exit("STP violation at Pi at tag " PRINTF_TAG, now.time - lf_time_start(), now.microstep);
  =}
}
reactor Gather {
  input[4] in: int
  output next: bool
  logical action a
  state count: int = 0
  reaction(startup, a) -> next {=
    lf_set(next, true);
  =}
  reaction(in) -> a {=
    tag_t now = lf_tag();
    for (int i = 0; i < 4; i++) {
      if (!in[i]->is_present) {
        lf_print_error_and_exit("Missing input %d in Gather at tag " PRINTF_TAG,
            i, now.time - lf_time_start(), now.microstep);
      }
    }
    lf_print("%d: at tag " PRINTF_TAG, self->count, now.time - lf_time_start(), now.microstep);
    self->count++;
    if (self->count == 4) {
      lf_request_stop();
    }
    lf_schedule(a, 0);
  =} STP (30 s) {=
    tag_t now = lf_tag();
    lf_print_error_and_exit("STP violation at Gather at tag " PRINTF_TAG, now.time - lf_time_start(), now.microstep);
  =}
  reaction(shutdown) {=
    if (self->count < 5) {
      lf_print_error_and_exit("Gather received only %d inputs. Expected at least 5.", self->count);
    } 
  =}
}
federated reactor {
  pi = new[4] Pi()
  g = new Gather()
  pi.out -> g.in
  (g.next)+ -> pi.trigger
}
@edwardalee edwardalee added the bug Something isn't working label Aug 2, 2024
@edwardalee edwardalee self-assigned this Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant