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

Stop time is not handled correctly with decentralized coordination #1166

Closed
edwardalee opened this issue May 13, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working federated

Comments

@edwardalee
Copy link
Collaborator

Minimal example:

target C {
    timeout: 5 sec,
    coordination: decentralized
}

reactor Count {
    output out:int;
    state c:int(0);
    timer t(0, 1 sec);
    reaction(t) -> out {=
        lf_set(out, self->c++);
    =}
}
reactor Print {
    input in:int;
    reaction(in) {=
        lf_print("***** Received: %d", in->value);
    =}
}

federated reactor {
    c = new Count();
    p = new Print();
    c.out -> p.in;
}

This gives the following execution:

Federate 1: ***** Received: 0
Federate 1: ***** Received: 1
Federate 1: ***** Received: 2
Federate 1: ***** Received: 3
Federate 1: ***** Received: 4
Federate 1: WARNING: Received message too late. Already at stopping time. Discarding message.
Federate 1 has resigned.

Notice that the input at time 5 is lost. Adding an STP offset does not help. It still gets lost.

@edwardalee edwardalee added bug Something isn't working federated labels May 13, 2022
@edwardalee
Copy link
Collaborator Author

Oops, sorry, adding an STP offset does in fact fix this problem. I believe the behavior is actually correct!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working federated
Projects
None yet
Development

No branches or pull requests

2 participants