Skip to content

Commit

Permalink
Add the NDT option in the RTI
Browse files Browse the repository at this point in the history
  • Loading branch information
byeonggiljun committed Oct 3, 2023
1 parent 052eab0 commit 5939d5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/federated/RTI/rti_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ void handle_next_event_tag(federate_t* fed) {
intended_tag
);
// If fed cannot get the grant of the intended tag, send NDTs to its upstream federates.
if (lf_tag_compare(fed->enclave.last_granted, intended_tag) < 0) {
send_upstream_next_downstream_tag(fed, intended_tag);
if (_f_rti->ndt_enabled) {
if (lf_tag_compare(fed->enclave.last_granted, intended_tag) < 0) {
send_upstream_next_downstream_tag(fed, intended_tag);
}
}
lf_mutex_unlock(&rti_mutex);
}
Expand Down Expand Up @@ -1789,6 +1791,8 @@ int process_args(int argc, const char* argv[]) {
} else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) {
lf_print("%s", version_info);
return 0;
} else if (strcmp(argv[i], "--ndt" == 0)) {
_f_rti->ndt_enabled = true;
} else if (strcmp(argv[i], " ") == 0) {
// Tolerate spaces
continue;
Expand Down Expand Up @@ -1827,5 +1831,6 @@ void initialize_RTI(){
_f_rti->clock_sync_exchanges_per_interval = 10,
_f_rti->authentication_enabled = false,
_f_rti->tracing_enabled = false;
_f_rti->ndt_enabled = true; // FIXME: Initialize this with true to test the feature
_f_rti->stop_in_progress = false;
}
5 changes: 5 additions & 0 deletions core/federated/RTI/rti_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ typedef struct federation_rti_t {
*/
bool authentication_enabled;

/**
* Boolean indicating that NDT message is enabled
*/
bool ndt_enabled;

/**
* Boolean indicating that a stop request is already in progress.
*/
Expand Down

0 comments on commit 5939d5a

Please sign in to comment.