From 1b8e7a7de8d18555ef7e8ad9e0b418380e7fbae3 Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Tue, 12 Mar 2024 17:47:23 -0700 Subject: [PATCH 1/5] Include clock-sync.h --- .../java/org/lflang/federated/extensions/CExtension.java | 5 +++-- core/src/main/resources/lib/c/reactor-c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/lflang/federated/extensions/CExtension.java b/core/src/main/java/org/lflang/federated/extensions/CExtension.java index be2075ae5c..775d7fe9c9 100644 --- a/core/src/main/java/org/lflang/federated/extensions/CExtension.java +++ b/core/src/main/java/org/lflang/federated/extensions/CExtension.java @@ -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( @@ -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;"); diff --git a/core/src/main/resources/lib/c/reactor-c b/core/src/main/resources/lib/c/reactor-c index 277d3f2951..28a97aeaae 160000 --- a/core/src/main/resources/lib/c/reactor-c +++ b/core/src/main/resources/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 277d3f295167b9f9f3b45356937af8cf57bef3b8 +Subproject commit 28a97aeaaefccb75365bf3dac681b5f552d79f12 From b75241bfbc66094ed1823ef77cdcb1ff4615684e Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Tue, 12 Mar 2024 17:49:12 -0700 Subject: [PATCH 2/5] Align reactor-c --- core/src/main/resources/lib/c/reactor-c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/c/reactor-c b/core/src/main/resources/lib/c/reactor-c index 28a97aeaae..7427d987d7 160000 --- a/core/src/main/resources/lib/c/reactor-c +++ b/core/src/main/resources/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 28a97aeaaefccb75365bf3dac681b5f552d79f12 +Subproject commit 7427d987d725111141139819c5341921edd0fef1 From 3bb1d2b0ac47c65de34b2fba19590f55cca95087 Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Tue, 12 Mar 2024 18:03:41 -0700 Subject: [PATCH 3/5] Spotless --- .../main/java/org/lflang/federated/extensions/CExtension.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/lflang/federated/extensions/CExtension.java b/core/src/main/java/org/lflang/federated/extensions/CExtension.java index 775d7fe9c9..28010a90ac 100644 --- a/core/src/main/java/org/lflang/federated/extensions/CExtension.java +++ b/core/src/main/java/org/lflang/federated/extensions/CExtension.java @@ -499,8 +499,8 @@ protected final void writePreambleFile( } /** - * Add preamble to a separate file to set up federated execution. Return an a string - * containing the #includes that are needed by the federate. + * 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( From 6b07ae5c6bea64d94d69cb1e7b83ad6a3ccb9b0a Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Tue, 12 Mar 2024 18:29:33 -0700 Subject: [PATCH 4/5] Added newline to prevent confusion of ending quote --- .../org/lflang/federated/launcher/FedLauncherGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java b/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java index 67cc8085f0..39153504df 100644 --- a/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java +++ b/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java @@ -389,7 +389,7 @@ 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", From 3474a5a98a0c7ab2d67da0f540416dd74348abcc Mon Sep 17 00:00:00 2001 From: "Edward A. Lee" Date: Tue, 12 Mar 2024 19:29:32 -0700 Subject: [PATCH 5/5] Spotless --- .../org/lflang/federated/launcher/FedLauncherGenerator.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java b/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java index 39153504df..332ee003c6 100644 --- a/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java +++ b/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java @@ -389,7 +389,11 @@ private String getRemoteLaunchCode( "ssh " + target + " 'mkdir -p log; \\", " echo \"-------------- Federation ID: \"'$FEDERATION_ID' >> " + logFileName + "; \\", " date >> " + logFileName + "; \\", - " echo \"Executing RTI: " + rtiLaunchString + "\n\" 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",