Skip to content

Commit

Permalink
Merge pull request #2243 from lf-lang/include-clock-sync
Browse files Browse the repository at this point in the history
Include clock sync for federated programs on multiple platforms.
  • Loading branch information
edwardalee authored Mar 13, 2024
2 parents 0deb8f9 + 3474a5a commit 9cab7b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ protected final void writePreambleFile(
}

/**
* Add preamble to a separate file to set up federated execution. Return an empty string since no
* code generated needs to go in the source.
* Add preamble to a separate file to set up federated execution. Return an a string containing
* the #includes that are needed by the federate.
*/
@Override
public String generatePreamble(
Expand Down Expand Up @@ -539,6 +539,7 @@ protected String makePreamble(
code.pr("#include \"core/federated/federate.h\"");
code.pr("#include \"core/federated/network/net_common.h\"");
code.pr("#include \"core/federated/network/net_util.h\"");
code.pr("#include \"core/federated/clock-sync.h\"");
code.pr("#include \"core/threaded/reactor_threaded.h\"");
code.pr("#include \"core/utils/util.h\"");
code.pr("extern federate_instance_t _fed;");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ private String getRemoteLaunchCode(
"ssh " + target + " 'mkdir -p log; \\",
" echo \"-------------- Federation ID: \"'$FEDERATION_ID' >> " + logFileName + "; \\",
" date >> " + logFileName + "; \\",
" echo \"Executing RTI: " + rtiLaunchString + "\" 2>&1 | tee -a " + logFileName + "; \\",
" echo \"Executing RTI: "
+ rtiLaunchString
+ "\n\" 2>&1 | tee -a "
+ logFileName
+ "; \\",
" # First, check if the RTI is on the PATH",
" if ! command -v RTI &> /dev/null",
" then",
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/lib/c/reactor-c
Submodule reactor-c updated 154 files

0 comments on commit 9cab7b4

Please sign in to comment.