@@ -175,6 +175,13 @@ parse_rti_code_t parse_rti_addr(const char* rti_addr);
175
175
void set_federation_id (const char * fid );
176
176
#endif
177
177
178
+ #ifdef SCHEDULER_QS
179
+ /**
180
+ * Path to the static schedule text file (specified on the command line)
181
+ */
182
+ char * static_schedule_path = NULL ;
183
+ #endif
184
+
178
185
/**
179
186
* Allocate memory using calloc (so the allocated memory is zeroed out)
180
187
* and record the allocated memory on the specified self struct so that
@@ -1618,6 +1625,7 @@ void schedule_output_reactions(reaction_t* reaction, int worker) {
1618
1625
downstream_reaction -> is_STP_violated , downstream_reaction -> name );
1619
1626
}
1620
1627
#endif
1628
+ #ifndef SCHEDULER_QS // Include the optimization (downstream_to_execute_now) if QS scheduler is not in use.
1621
1629
if (downstream_reaction != NULL && downstream_reaction != downstream_to_execute_now ) {
1622
1630
num_downstream_reactions ++ ;
1623
1631
// If there is exactly one downstream reaction that is enabled by this
@@ -1646,11 +1654,16 @@ void schedule_output_reactions(reaction_t* reaction, int worker) {
1646
1654
_lf_trigger_reaction (downstream_reaction , worker );
1647
1655
}
1648
1656
}
1657
+ #else // If QS scheduler is used, exclude the optimization so that it does not affect quasi-static scheduling.
1658
+ // Queue the reaction.
1659
+ _lf_trigger_reaction (downstream_reaction , worker );
1660
+ #endif // SCHEDULER_QS
1649
1661
}
1650
1662
}
1651
1663
}
1652
1664
}
1653
1665
}
1666
+ #ifndef SCHEDULER_QS // Exclude the optimization so that it does not affect quasi-static scheduling.
1654
1667
if (downstream_to_execute_now != NULL ) {
1655
1668
LF_PRINT_LOG ("Worker %d: Optimizing and executing downstream reaction now: %s" , worker , downstream_to_execute_now -> name );
1656
1669
bool violation = false;
@@ -1730,6 +1743,7 @@ void schedule_output_reactions(reaction_t* reaction, int worker) {
1730
1743
LF_PRINT_DEBUG ("Finally, reset reaction's is_STP_violated field to false: %s" ,
1731
1744
downstream_to_execute_now -> name );
1732
1745
}
1746
+ #endif // SCHEDULER_QS
1733
1747
}
1734
1748
1735
1749
/**
@@ -1797,6 +1811,10 @@ void usage(int argc, const char* argv[]) {
1797
1811
printf (" -r, --rti <n>\n" );
1798
1812
printf (" The address of the RTI, which can be in the form of user@host:port or ip:port.\n\n" );
1799
1813
#endif
1814
+ #ifdef SCHEDULER_QS
1815
+ printf (" -s, --static-schedule <n>\n" );
1816
+ printf (" The path to the static schedule text file.\n\n" );
1817
+ #endif
1800
1818
1801
1819
printf ("Command given:\n" );
1802
1820
for (int i = 0 ; i < argc ; i ++ ) {
@@ -1946,7 +1964,12 @@ int process_args(int argc, const char* argv[]) {
1946
1964
return 0 ;
1947
1965
}
1948
1966
}
1949
- #endif
1967
+ #endif
1968
+ #ifdef SCHEDULER_QS
1969
+ else if (strcmp (arg , "- s ") == 0 || strcmp(arg, " -- static - schedule ") == 0) {
1970
+ static_schedule_path = argv [i ++ ];
1971
+ }
1972
+ #endif
1950
1973
else if (strcmp (arg , "--ros-args" ) == 0 ) {
1951
1974
// FIXME: Ignore ROS arguments for now
1952
1975
} else {
0 commit comments