Add tutorial READMEs and fix tutorial return codes

Add README.md files for moeo/tutorial/Lesson{1-4}, smp/tutorial/Lesson{1-4},
and mo/tutorial/Lesson9 — these tutorials had no documentation.

Fix return 1 → return 0 in 28 tutorial main() functions across mo/ and
smp/ that unconditionally returned failure status.
This commit is contained in:
Eremey Valetov 2026-02-28 19:24:05 -05:00
commit c1a44fd2a6
37 changed files with 371 additions and 30 deletions

View file

@ -0,0 +1,31 @@
# Dynamic island topology
Three islands start with a ring topology and switch to a complete topology
after 10 seconds of computation.
Same QAP problem as Lessons 1-2.
## Running
From the `build/smp/tutorial/Lesson4` directory:
```shell
./lesson4_topology
```
## How it works
A callback function registered with the islands triggers the topology
change:
```c++
void changeTopo(IslandModel<Indi>* _model, AbstractTopology& _topo)
{
// ... after 10 seconds:
_model->setTopology(_topo);
}
```
The topology can be changed at runtime via `model.setTopology()`, so you
can implement adaptive communication patterns based on time, convergence,
or any other criterion.