You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,16 @@ After creation, clone **your** new repository locally and follow [Running the Co
87
87
88
88
## Running the Code
89
89
90
-
All `.lf` files in this repository are federated LF programs. Compile an example with `lfc`:
90
+
All `.lf` files in this repository are [federated (distributed) LF programs](https://www.lf-lang.org/docs/writing-reactors/distributed-execution/), called **federations** in the LF documentation.
91
+
In an LF federation, each top-level reactor is a **federate**;
92
+
the LF compiler generates a separate program for each federate and synthesizes the communication between them, with the runtime infrastructure (RTI) coordinating federates.
93
+
94
+
These examples use [**decentralized coordination**](https://www.lf-lang.org/docs/writing-reactors/distributed-execution/#decentralized-coordination), where the RTI handles startup, shutdown, and clock synchronization but is otherwise not involved in execution.
95
+
Federates communicate directly through dedicated sockets and advance logical time using [`maxwait`](https://www.lf-lang.org/docs/writing-reactors/distributed-execution/#maxwait) instead of consulting the RTI.
96
+
97
+
See the LF [distributed execution instructions](https://www.lf-lang.org/docs/writing-reactors/distributed-execution/) for more details.
98
+
99
+
Now, compile an example with `lfc`:
91
100
92
101
```bash
93
102
lfc src/<filename>.lf
@@ -99,28 +108,30 @@ For example:
99
108
lfc src/Step1_Actor.lf
100
109
```
101
110
102
-
Compilation generates a launcher under `bin/` with the same base name as the source file, without the `.lf` extension. For `src/Step1_Actor.lf`, the launcher is:
111
+
Compilation generates a launcher script under `bin/` with the same base name as the source file, without the `.lf` extension.
112
+
The script starts the runtime infrastructure (RTI) and all federates for that federation.
113
+
114
+
For `src/Step1_Actor.lf`, to run the generated launcher:
103
115
104
116
```bash
105
117
./bin/Step1_Actor
106
118
```
107
119
108
-
That launcher starts the runtime infrastructure (RTI) and all federates for the example. There is no `_launch.sh` script in this repository.
109
-
110
120
To run a different step, replace the filename and launcher name:
111
121
112
122
```bash
113
123
lfc src/Step5_Hybrid.lf
114
124
./bin/Step5_Hybrid
115
125
```
116
126
117
-
The launcher also supports tmux panes, which can make federated output easier to read:
127
+
The launcher also supports tmux panes, which can make multiple outputs from each federate and the RTI easier to read:
118
128
119
129
```bash
120
130
./bin/Step1_Actor --tmux
121
131
```
122
132
123
-
Step 1 exits on its own because it has a short timeout. Other steps may keep running until you stop them with `Ctrl+C` in the launcher or RTI pane.
133
+
Step 1 exits on its own because it has a short timeout.
134
+
Other steps may keep running until you stop them with `Ctrl+C` in the launcher or RTI pane.
0 commit comments