Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Introduce the next downstream tag (NDT) to optimize the communication in centralized federated execution #2114

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
3 changes: 2 additions & 1 deletion .github/actions/install-rti/install.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
cd core/src/main/resources/lib/c/reactor-c/core/federated/RTI
docker build -t lflang/rti:rti -f rti.Dockerfile ../../../core/
mkdir build
cd build
if [[ "$OSTYPE" == "darwin"* ]]; then
export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"
fi
cmake -DAUTH=ON ../
make
sudo make install
sudo make install
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.lflang.target.property.AuthProperty;
import org.lflang.target.property.ClockSyncModeProperty;
import org.lflang.target.property.ClockSyncOptionsProperty;
import org.lflang.target.property.NDTProperty;
import org.lflang.target.property.TracingProperty;
import org.lflang.target.property.type.ClockSyncModeType.ClockSyncMode;

Expand Down Expand Up @@ -339,6 +340,9 @@ private String getRtiCommand(List<FederateInstance> federates, boolean isRemote)
if (targetConfig.getOrDefault(AuthProperty.INSTANCE)) {
commands.add(" -a \\");
}
if (targetConfig.getOrDefault(NDTProperty.INSTANCE)) {
commands.add(" --ndt \\");
}
if (targetConfig.getOrDefault(TracingProperty.INSTANCE).isEnabled()) {
commands.add(" -t \\");
}
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/org/lflang/target/Target.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.lflang.target.property.ExternalRuntimePathProperty;
import org.lflang.target.property.FilesProperty;
import org.lflang.target.property.KeepaliveProperty;
import org.lflang.target.property.NDTProperty;
import org.lflang.target.property.NoRuntimeValidationProperty;
import org.lflang.target.property.NoSourceMappingProperty;
import org.lflang.target.property.PlatformProperty;
Expand Down Expand Up @@ -599,6 +600,7 @@ public void initialize(TargetConfig config) {
DockerProperty.INSTANCE,
FilesProperty.INSTANCE,
KeepaliveProperty.INSTANCE,
NDTProperty.INSTANCE,
NoSourceMappingProperty.INSTANCE,
PlatformProperty.INSTANCE,
ProtobufsProperty.INSTANCE,
Expand Down Expand Up @@ -633,6 +635,7 @@ public void initialize(TargetConfig config) {
DockerProperty.INSTANCE,
FilesProperty.INSTANCE,
KeepaliveProperty.INSTANCE,
NDTProperty.INSTANCE,
NoSourceMappingProperty.INSTANCE,
ProtobufsProperty.INSTANCE,
SchedulerProperty.INSTANCE,
Expand Down
25 changes: 25 additions & 0 deletions core/src/main/java/org/lflang/target/property/NDTProperty.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.lflang.target.property;

/**
* If true, the RTI will send NDT messages to federates to reduce the number of messages.
* The default is false.
*/
public final class NDTProperty extends BooleanProperty {

/** Singleton target property instance. */
public static final NDTProperty INSTANCE = new NDTProperty();

private NDTProperty() {
super();
}

@Override
public Boolean initialValue() {
return true;
}

@Override
public String name() {
return "ndt";
}
}