Skip to content

Commit fbab2d0

Browse files
committed
Add clarifiation for Step 1.
1 parent 61a20f0 commit fbab2d0

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ After creation, clone **your** new repository locally and follow [Running the Co
8787

8888
## Running the Code
8989

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`:
91100

92101
```bash
93102
lfc src/<filename>.lf
@@ -99,28 +108,30 @@ For example:
99108
lfc src/Step1_Actor.lf
100109
```
101110

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:
103115

104116
```bash
105117
./bin/Step1_Actor
106118
```
107119

108-
That launcher starts the runtime infrastructure (RTI) and all federates for the example. There is no `_launch.sh` script in this repository.
109-
110120
To run a different step, replace the filename and launcher name:
111121

112122
```bash
113123
lfc src/Step5_Hybrid.lf
114124
./bin/Step5_Hybrid
115125
```
116126

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:
118128

119129
```bash
120130
./bin/Step1_Actor --tmux
121131
```
122132

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.
124135

125136
## References
126137

0 commit comments

Comments
 (0)