1# @ajax/meshd
23meshd: the host daemon of the GPU mesh: the executors, the driver, the control and HTTP ports, the
4samplers, the jobs and blob threads (@ajax/mesh-jobd), and in a fleet the member's links, leader and
5reconciler (@ajax/mesh-fleetd over @ajax/mesh-peer-relay).
67```
8meshd --backend wasm --programs out/programs --autoload
9meshd --backend wasm --programs out/programs --cluster cluster.conf --system 1 --fleet-state /var/lib/meshd/fleet
10```
1112## Ported from
1314[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/main.rs: `main` (the fleet state before anything runs, the job log and the blob store, the jobs, blob and fleet threads), `install_signals`, `watchdog`, `SHUTDOWN_LIMIT`, `hostname`, `bind`, `open_cuda`.
1516## Tests
1718- `tests/meshd.c`: a whole CPU-only meshd (`--backend wasm`) in a child process, on a catalog with the real programs/hello-wasm and a native worker (apps/mesh-test-worker): autoload, tasks, stop/start, reset, unload/load, peek, `programs`, the views, a native crash failing only that program, `--state`, SIGINT and exit 0; the CUDA backend without a GPU exits 1, a bad flag 2.
1920- `tests/cluster.c`: three whole meshds (`--backend wasm`) on loopback as one fleet: one leader agreed by all, `load`/`start` asked of a follower committed and reconciled everywhere, a 240-item hashjob array through a follower with every item exactly once and every result recomputed (mesh-ref sha256d), `jobs` on every member, the HTTP relay, a member killed (SIGKILL) seen down while the two left keep their leader and commit, exit 0 on SIGTERM.
2122## Differences
2324- The executors line names the C wasm interpreter where the Rust names wasmtime.
2526## Licence
2728MIT. See the repository's LICENSE.