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

Get enclaves refactoring working with minimal changes to lingua-franca #298

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7be7465
Point lingua-franca-ref.txt to master to see whether we can get tests…
edwardalee Oct 28, 2023
2807e1d
Put current fed/enclave into visited array
edwardalee Oct 28, 2023
fa8bbc3
Update lingua-franca-ref.txt to point to enclaves3 branch.
edwardalee Oct 28, 2023
c6343fe
Fix function template
edwardalee Oct 28, 2023
d336937
Acquire global mutex, not enclave-local one
edwardalee Oct 28, 2023
8f78134
Merge branch 'enclaves2' into enclaves3
edwardalee Oct 29, 2023
fc7b300
Fixing transitive next event
edwardalee Oct 30, 2023
1e44a45
Reverted mutex change
edwardalee Oct 31, 2023
15dbee7
Added comment about precomputing shortest path
edwardalee Oct 31, 2023
f5f7a5e
Removed comments from .c file and tuned comments
edwardalee Oct 31, 2023
fceeb9d
Print federate name for lf_print
edwardalee Oct 31, 2023
4648bff
Moved _lf_get_environments to environment.h
edwardalee Oct 31, 2023
dfb515e
Implement _lf_get_environments stub for unit tests
erlingrj Oct 31, 2023
7548cfc
Removed not too helpful debug message
edwardalee Oct 31, 2023
fbf9950
Enabled compilation for standalone RTI
edwardalee Oct 31, 2023
6ce3364
Typo
edwardalee Nov 5, 2023
fd98f3a
Handle cycles better
edwardalee Nov 5, 2023
a97fdc1
Merge branch 'enclaves2' into enclaves3
edwardalee Nov 5, 2023
1a05436
Malloc memory only for array sizes > 0
edwardalee Nov 6, 2023
f7c80af
Free dynamically allocated memory
edwardalee Nov 6, 2023
6f77e1c
Merge remote-tracking branch 'origin/main' into enclaves3-erj
erlingrj Nov 8, 2023
19249c8
Merge branch 'enclaves2' into enclaves3
erlingrj Nov 8, 2023
158260b
add _locked version of stop_trace to be called from within critical s…
erlingrj Nov 8, 2023
4e9c1a2
Protect next_reaction_level against overflow
edwardalee Nov 8, 2023
e4bae13
Resolved merge conflicts on comments (only).
edwardalee Nov 10, 2023
c270761
Update lf-ref
erlingrj Nov 10, 2023
6d67ceb
Fix superflous newline in logging
erlingrj Nov 10, 2023
f9e787b
RTI: Add zero-delay-cycle detection
erlingrj Nov 10, 2023
65f491c
RTI: Only give a PTAG if there is a zero-delay cycle
erlingrj Nov 10, 2023
a192cf9
RTI: Print out ZDC detected by the RTI
erlingrj Nov 10, 2023
301dac6
Improve documentation
erlingrj Nov 10, 2023
b3e2251
Comments only
edwardalee Nov 10, 2023
3a67cb8
Resolved conflicts with enclaves2
edwardalee Nov 12, 2023
f68e56a
Merge pull request #242 from lf-lang/enclaves2
erlingrj Nov 13, 2023
349cd58
Update lingua-franca-ref.txt
erlingrj Nov 13, 2023
9ff9ebe
Make lf_delay_tag exactly match the theory
edwardalee Nov 14, 2023
1d710c6
Merge pull request #307 from lf-lang/erlingrj-patch-3
erlingrj Nov 14, 2023
c810a11
Merge branch 'enclaves2' into enclaves3
edwardalee Nov 17, 2023
2d2757f
Refactor pqueue part 1
edwardalee Nov 11, 2023
515e6ae
Refactor pqueue part 2
edwardalee Nov 11, 2023
544e099
Docs and lf-ref
edwardalee Nov 11, 2023
aaad588
First step at a pqueue with tag sorting
edwardalee Nov 11, 2023
0406ee7
Implemented and tested priority queue with tag ordering
edwardalee Nov 12, 2023
899b5e8
Free element on popping a tag
edwardalee Nov 12, 2023
21501bf
Fix memory error in unit test
edwardalee Nov 12, 2023
d0dfdb5
Do not insert a duplicate tag into the tag-based priority queue
byeonggiljun Nov 15, 2023
e437092
Update lingua-franca-ref.txt
erlingrj Nov 13, 2023
7dba9f3
Add a function for searching the tag and a test for it
byeonggiljun Nov 15, 2023
1583eee
Free dynamic memory in the tag-based pqueue unit test
byeonggiljun Nov 15, 2023
1101f0d
Let the searching function only needs a tag to find an element
byeonggiljun Nov 15, 2023
cb989e5
Don't use malloc when finding a tag inside the pqueue_tag and add ins…
byeonggiljun Nov 15, 2023
4e6921d
Removed unnecessary imports
edwardalee Nov 18, 2023
a3411ee
Simplified tag insertion
edwardalee Nov 18, 2023
2c856bd
Cache minimum upstream delays
edwardalee Nov 18, 2023
1949d39
Merge branch 'main' into enclaves3
edwardalee Nov 23, 2023
fad8855
Send PTAG only if in ZDC
edwardalee Nov 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions core/federated/RTI/rti_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#if defined STANDALONE_RTI || defined LF_ENCLAVES
#include "rti_common.h"

extern lf_mutex_t rti_mutex;
edwardalee marked this conversation as resolved.
Show resolved Hide resolved

/**
* Local reference to rti_common_t instance.
*/
Expand Down Expand Up @@ -52,7 +54,7 @@ void initialize_scheduling_node(scheduling_node_t* e, uint16_t id) {
void _logical_tag_complete(scheduling_node_t* enclave, tag_t completed) {
// FIXME: Consolidate this message with NET to get NMR (Next Message Request).
// Careful with handling startup and shutdown.
lf_mutex_lock(rti_common->mutex);
lf_mutex_lock(&rti_mutex);

enclave->completed = completed;

Expand All @@ -70,7 +72,7 @@ void _logical_tag_complete(scheduling_node_t* enclave, tag_t completed) {
free(visited);
}

lf_mutex_unlock(rti_common->mutex);
lf_mutex_unlock(&rti_mutex);
}

tag_advance_grant_t tag_advance_grant_if_safe(scheduling_node_t* e) {
Expand Down Expand Up @@ -115,6 +117,7 @@ tag_advance_grant_t tag_advance_grant_if_safe(scheduling_node_t* e) {
// To handle cycles, need to create a boolean array to keep
// track of which upstream enclave have been visited.
bool *visited = (bool *)calloc(rti_common->number_of_scheduling_nodes, sizeof(bool)); // Initializes to 0.
visited[e->id] = true;
erlingrj marked this conversation as resolved.
Show resolved Hide resolved

// Find the tag of the earliest possible incoming message from
// upstream enclaves.
Expand Down
1 change: 1 addition & 0 deletions core/federated/RTI/rti_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void notify_provisional_tag_advance_grant(scheduling_node_t* e, tag_t tag) {
// To handle cycles, need to create a boolean array to keep
// track of which upstream federates have been visited.
bool* visited = (bool*)calloc(rti_remote->base.number_of_scheduling_nodes, sizeof(bool)); // Initializes to 0.
visited[upstream->enclave.id] = true;

// Find the (transitive) next event tag upstream.
tag_t upstream_next_event = transitive_next_event(
Expand Down
2 changes: 1 addition & 1 deletion core/federated/RTI/rti_remote.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ int process_args(int argc, const char* argv[]);
/**
* Initialize the _RTI instance.
*/
void initialize_RTI();
void initialize_RTI(rti_remote_t *rti);

#endif // RTI_REMOTE_H
#endif // STANDALONE_RTI
2 changes: 1 addition & 1 deletion lingua-franca-ref.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
enclaves2
enclaves3
Loading