Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
7e82a1b
Start on transient federates: Add cmdline argument -nt to RTI and cre…
ChadliaJerad Mar 24, 2023
c236f06
RTI does not exist if a transient federate exits, but does when a per…
ChadliaJerad Mar 24, 2023
8871b51
Merge branch 'main' into transient-federates
ChadliaJerad Mar 27, 2023
da78961
Add is_transient attribute to the federate data stucture
ChadliaJerad Mar 27, 2023
62e0a87
Merge branch 'main' into transient-federates
ChadliaJerad Mar 28, 2023
9f5aca4
Federate sends its type (transient or not) to RTI or p2p federate tog…
ChadliaJerad Mar 28, 2023
190a211
Add reset transient federate.
ChadliaJerad Apr 5, 2023
13d8409
The number of transient federates (given as cmdline argument) can be 0
ChadliaJerad Apr 6, 2023
20817f1
Add canvas to identify if a TIMESTAMP message if received from a trab…
ChadliaJerad Apr 10, 2023
4a9b9c8
Add new message types and handle the start_time of trabsient federate…
ChadliaJerad Apr 12, 2023
b570310
Merge branch 'main' into transient-federates
ChadliaJerad Apr 12, 2023
86a1a47
Fix buffer reading of the timestamp when dealing with transient start…
ChadliaJerad Apr 14, 2023
3f29f1d
A non clean workig version that uses the min of the current tag of th…
ChadliaJerad Apr 14, 2023
8a442f5
Reset message_tag_is_in_the_fiture condition
ChadliaJerad Apr 17, 2023
0c0ccff
Fix the number of workers, so that no segmentation fault accurs when …
ChadliaJerad Apr 18, 2023
33191e9
Iterate over the number of persistant AND transient federates + Minor…
ChadliaJerad Apr 18, 2023
2fc8f2a
Remove non useful message log.
ChadliaJerad Apr 18, 2023
fd2eab8
Merge branch 'main' into transient-federates
ChadliaJerad Apr 25, 2023
df9bd41
Set the start time of a trabsient to be the max among current tags of…
ChadliaJerad Apr 25, 2023
22b8657
Better messages and function names.
ChadliaJerad Apr 26, 2023
9a788e9
Clean useless functions
ChadliaJerad Apr 26, 2023
ad23fe0
Fix error found by CI: there is no i in connect_to_transient_federate…
ChadliaJerad Apr 26, 2023
c925e41
Another error fix brought up by CI, about the usage of thread_id.
ChadliaJerad Apr 26, 2023
190ed02
Get rid of pthread_tryjoin_np(), for the sake of portability and CI.
ChadliaJerad Apr 26, 2023
e62fe09
Merge branch 'main' into transient-federates
ChadliaJerad Apr 27, 2023
3bf95e8
Remove non useful code
ChadliaJerad Apr 27, 2023
c35cfd1
Tentative solution for granting time advance in a federate with absen…
ChadliaJerad Apr 27, 2023
e17ffc7
Better logging for absent transient federates
ChadliaJerad Apr 29, 2023
6024e43
Merge branch 'main' into transient-federates
ChadliaJerad May 2, 2023
2856f34
Create a different trace file if there is already one. This is tempor…
ChadliaJerad May 3, 2023
825fbc1
Add the global variable effective_start_time. It is useful for transi…
ChadliaJerad May 3, 2023
fababed
Define and use effective_start_time to start a transient federate. Ad…
ChadliaJerad May 4, 2023
82cfe8c
Better trace visualization
ChadliaJerad May 5, 2023
79a67ff
Get rid of access() of unistd.h, so that Zephyr tests pass.
ChadliaJerad May 6, 2023
1efa26f
Merge branch 'rti-refactoring' into transient-federates
ChadliaJerad Jun 7, 2023
c41f0ed
Remove redundant declaration.
ChadliaJerad Jun 7, 2023
5a52ea7
Merge branch 'rti-refactoring' into transient-federates
ChadliaJerad Jun 7, 2023
af093e4
Pass to fix merge errors.
ChadliaJerad Jun 7, 2023
e61ea4d
More merge fixes.
ChadliaJerad Jun 8, 2023
c5282fb
Merge branch 'rti-refactoring' into transient-federates
ChadliaJerad Jun 8, 2023
64c34bd
Fix merge conflicts.
ChadliaJerad Jun 8, 2023
cd0a992
Fix the call to lf_thread_join()
ChadliaJerad Jun 8, 2023
092f5eb
Merge branch 'main' into transient-federates
ChadliaJerad Jun 9, 2023
f697019
Minor fixes and Make the effective start as a tag rather than a time
ChadliaJerad Jun 9, 2023
a9a0d16
Merge branch 'main' into transient-federates
ChadliaJerad Jun 9, 2023
18f75c6
Attempt to make tests pass on Windows
ChadliaJerad Jun 9, 2023
cfa573b
Merge branch 'main' into transient-federates
ChadliaJerad Jun 10, 2023
0da38c5
Attempt to make MacOs tests pass.
ChadliaJerad Jun 10, 2023
c7110ec
Merge main into transient-federates
ChadliaJerad Jun 15, 2023
62c9fe7
Fix after merge
ChadliaJerad Jun 15, 2023
f670496
Merge branch 'main' into transient-federates
ChadliaJerad Jun 20, 2023
2f6ae6c
Fix redundant messages
ChadliaJerad Jun 23, 2023
b5fb4a1
Monor fixes
ChadliaJerad Jun 23, 2023
4eb1b1d
Another minor fix
ChadliaJerad Jun 23, 2023
438611d
Merge branch 'main' into transient-federates
ChadliaJerad Jun 26, 2023
4886e7a
Merge branch 'main' into transient-federates
ChadliaJerad Jun 28, 2023
e860eab
Merge branch 'main' into transient-federates
ChadliaJerad Jul 5, 2023
05a8636
Fix wrong fed id in tracing absent messages
ChadliaJerad Jul 5, 2023
dc1728e
Access the id, not the federate
ChadliaJerad Jul 5, 2023
36393ed
Merge branch 'fix-tracing-abs' into transient-federates
ChadliaJerad Jul 5, 2023
b0bea8d
Fix the first waiting time of a transient
ChadliaJerad Jul 5, 2023
f66f39a
Merge branch 'main' into transient-federates
ChadliaJerad Jul 6, 2023
e7146d9
Compute TAG of transients' downstream, and assign a TAG even when a f…
ChadliaJerad Jul 17, 2023
44aea06
Merge branch 'main' into transient-federates
ChadliaJerad Jul 17, 2023
120599d
Final way to issue a TAG for federates with tansient upstreams
ChadliaJerad Jul 22, 2023
b4c4662
Merge branch 'main' into transient-federates
ChadliaJerad Jul 22, 2023
e7ac763
Merge branch 'main' into transient-federates
ChadliaJerad Jul 26, 2023
4c38eec
Sending PATG can be delayed as well, if a trabsient's downstream has …
ChadliaJerad Jul 27, 2023
92a5d1d
Fix timeout error of the RTI
ChadliaJerad Jul 28, 2023
33d8ae4
Make sure a pending tagand a pending ptag are mutually exclusive. Adj…
ChadliaJerad Jul 28, 2023
6c95b51
Update lingua-franca-ref.txt to point to transient-federates branch
ChadliaJerad Jul 28, 2023
fdefa3e
Merge branch 'main' into transient-federates
ChadliaJerad Jul 28, 2023
ef6ab52
Fix format warning to get more output
ChadliaJerad Aug 1, 2023
9195911
Less format warning
ChadliaJerad Aug 3, 2023
27150bf
Add lf_stop()
ChadliaJerad Aug 4, 2023
9a8f97c
Add lf_get_federates_bin_directory.
petervdonovan Aug 4, 2023
584c85f
Add lf_get_federation_id()
ChadliaJerad Aug 5, 2023
644ed2c
More doc
ChadliaJerad Aug 7, 2023
11314fc
Fix typo
ChadliaJerad Aug 7, 2023
12efc49
Add lf_get_start_time() and lf_get_effective_start_time() to federate
ChadliaJerad Aug 7, 2023
1f339a6
When waiting for transients to join, do not error and exit if no sock…
ChadliaJerad Aug 7, 2023
8dcc23a
Fix wrong type
ChadliaJerad Aug 7, 2023
53c6ad9
Insert message to debug CI
ChadliaJerad Aug 7, 2023
be897db
Fix message to debug CI
ChadliaJerad Aug 7, 2023
204040e
Attempt to understand what happens in Transients.lf in CI
ChadliaJerad Aug 8, 2023
3d4332b
Attempt to solve a corner case related to the startime of a transient…
ChadliaJerad Aug 8, 2023
7249e0c
Clean logging after timestamp issue fixed
ChadliaJerad Aug 8, 2023
25beb95
Make transients timers in sync with the federation start_time, not th…
ChadliaJerad Aug 9, 2023
abcb6be
Merge branch 'main' into transient-federates
ChadliaJerad Aug 15, 2023
c0f9d72
Cleanup residual code and comments
ChadliaJerad Aug 15, 2023
b8c5869
Add rti phase
ChadliaJerad Aug 15, 2023
2195be9
Add hot_swap_federate instance
ChadliaJerad Aug 15, 2023
fef4b80
Effective start time computation of a transition accounts for its 'in…
ChadliaJerad Aug 17, 2023
100ea5f
hot_swap_federate does not need to be in the scope of rti.c
ChadliaJerad Aug 17, 2023
5b53955
Add (immediate) stop requests handling in the federates
ChadliaJerad Aug 18, 2023
1c579bb
Add support of the hot swap mechasism
ChadliaJerad Aug 18, 2023
1909f95
Merge branch 'main' into transient-federates
ChadliaJerad Aug 18, 2023
af7f10d
Merge branch 'fix-fedsd-symlink' into transient-federates
ChadliaJerad Aug 18, 2023
47a2612
Add support for STOP message in fedsd
ChadliaJerad Aug 18, 2023
d2fe0d2
Merge branch 'fix-fedsd-symlink' into transient-federates
ChadliaJerad Aug 19, 2023
b4c991f
Merge branch 'fix-fedsd-symlink' into transient-federates
ChadliaJerad Aug 22, 2023
89de3fb
Re-add the support of stop messages
ChadliaJerad Aug 23, 2023
4075616
Add Stop message to fedsd
ChadliaJerad Aug 23, 2023
e4775dd
Merge branch 'fix-fedsd-symlink' into transient-federates
ChadliaJerad Aug 23, 2023
3ddc540
Revert "Make transients timers in sync with the federation start_time…
ChadliaJerad Aug 23, 2023
e2acf9b
Revert "Remove the path to trace_to_csv, as no longer valid"
ChadliaJerad Aug 24, 2023
a7fe3b7
Merge branch 'main' into transient-federates
ChadliaJerad Aug 24, 2023
777c291
Merge branch 'fix-fedsd-symlink' into transient-federates
ChadliaJerad Aug 24, 2023
3ceb2ba
Merge branch 'main' into transient-federates
ChadliaJerad Sep 14, 2023
0b45142
Merge branch 'main' into transient-federates
ChadliaJerad Sep 21, 2023
f2354f9
Merge branch 'main' into transient-federates
ChadliaJerad Sep 26, 2023
e69e786
Merge branch 'main' into transient-federates
ChadliaJerad Oct 2, 2023
aa81a55
Merge branch 'main' into transient-federates
ChadliaJerad Oct 3, 2023
9d22662
Merge branch 'main' into transient-federates
ChadliaJerad Oct 10, 2023
21d5e70
Move functions declarations, so that they become visible at the lf pr…
ChadliaJerad Oct 10, 2023
b58e4a5
Merge branch 'main' into transient-federates
ChadliaJerad Nov 13, 2023
d790105
Remove wrongly inserted redundant function declaration after merge
ChadliaJerad Nov 13, 2023
55158ea
Fix the federate util functions declarations
ChadliaJerad Nov 13, 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
1 change: 1 addition & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ define(USER_THREADS)
define(SCHEDULER)
define(LF_SOURCE_DIRECTORY)
define(LF_PACKAGE_DIRECTORY)
define(LF_FEDERATES_BIN_DIRECTORY)
define(LF_FILE_SEPARATOR)
19 changes: 17 additions & 2 deletions core/federated/RTI/enclave.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ void logical_tag_complete(enclave_t* enclave, tag_t completed) {
tag_advance_grant_t tag_advance_grant_if_safe(enclave_t* e) {
tag_advance_grant_t result = {.tag = NEVER_TAG, .is_provisional = false};

// Check how many upstream federates are connected
int num_connected_upstream = 0;

// Find the earliest LTC of upstream enclaves (M).
tag_t min_upstream_completed = FOREVER_TAG;

Expand All @@ -72,6 +75,8 @@ tag_advance_grant_t tag_advance_grant_if_safe(enclave_t* e) {
// Ignore this enclave if it no longer connected.
if (upstream->state == NOT_CONNECTED) continue;

num_connected_upstream++;

// Adjust by the "after" delay.
// Note that "no delay" is encoded as NEVER,
// whereas one microstep delay is encoded as 0LL.
Expand All @@ -81,16 +86,25 @@ tag_advance_grant_t tag_advance_grant_if_safe(enclave_t* e) {
min_upstream_completed = candidate;
}
}

LF_PRINT_LOG("Minimum upstream LTC for federate/enclave %d is " PRINTF_TAG
"(adjusted by after delay).",
e->id,
min_upstream_completed.time - start_time, min_upstream_completed.microstep);
if (lf_tag_compare(min_upstream_completed, e->last_granted) > 0

if (num_connected_upstream == 0) {
// When none of the upstream federates is connected (case of transients),
if (lf_tag_compare(e->next_event, FOREVER_TAG) != 0) {
result.tag = e->next_event;
return result;
}
} else if (
lf_tag_compare(min_upstream_completed, e->last_granted) > 0
&& lf_tag_compare(min_upstream_completed, e->next_event) >= 0 // The enclave has to advance its tag
) {
result.tag = min_upstream_completed;
return result;
}
}

// Can't make progress based only on upstream LTCs.
// If all (transitive) upstream enclaves of the enclave
Expand Down Expand Up @@ -257,6 +271,7 @@ tag_advance_grant_t next_event_tag(enclave_t* e, tag_t next_event_tag) {

void notify_advance_grant_if_safe(enclave_t* e) {
tag_advance_grant_t grant = tag_advance_grant_if_safe(e);

if (lf_tag_compare(grant.tag, NEVER_TAG) != 0) {
if (grant.is_provisional) {
notify_provisional_tag_advance_grant(e, grant.tag);
Expand Down
9 changes: 6 additions & 3 deletions core/federated/RTI/rti.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ int main(int argc, const char* argv[]) {

lf_print("Tracing the RTI execution in %s file.", rti_trace_file_name);
}
lf_print("Starting RTI for a total of %d federates, with %d being transient, in federation ID %s", \
_f_rti->number_of_enclaves,
_f_rti->number_of_transient_federates,
_f_rti->federation_id);

lf_print("Starting RTI for %d federates in federation ID %s.", _f_rti->number_of_enclaves, _f_rti->federation_id);
assert(_f_rti->number_of_enclaves < UINT16_MAX);

assert(_f_rti->number_of_transient_federates < UINT16_MAX);

// Allocate memory for the federates
_f_rti->enclaves = (federate_t**)calloc(_f_rti->number_of_enclaves, sizeof(federate_t*));
for (uint16_t i = 0; i < _f_rti->number_of_enclaves; i++) {
Expand All @@ -129,6 +133,5 @@ int main(int argc, const char* argv[]) {

int socket_descriptor = start_rti_server(_f_rti->user_specified_port);
wait_for_federates(socket_descriptor);
lf_print("RTI is exiting.");
return 0;
}
Loading