What a mesh program sees (Ctx): views, peer views, input queue, pipes, request window, exchange page, counters, ids
$ sexc add @ajax/mesh-rt-ctx- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 03:26v/# 1 version
- drwxr-xr-x-Oct 27 03:26files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 03:26 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-abi-base ^0.1.0, @ajax/mesh-abi-control-block ^0.1.0, @ajax/mesh-abi-exchange ^0.1.0, @ajax/mesh-abi-ext ^0.1.0, @ajax/mesh-abi-fault ^0.1.0, @ajax/mesh-abi-header ^0.1.0, @ajax/mesh-abi-input-queue ^0.1.0, @ajax/mesh-abi-pipe ^0.1.0, @ajax/mesh-abi-pipe-ring ^0.1.0, @ajax/mesh-abi-program-table ^0.1.0, @ajax/mesh-abi-words ^0.1.0, @ajax/mesh-rt-block ^0.1.0, @ajax/mesh-rt-prim ^0.1.0, @ajax/mesh-rt-view ^0.1.0
- dependents
- @ajax/mesh-rt, @ajax/mesh-rt-linalg, @ajax/mesh-rt-loop
- keywords
- mesh alphaos gpu runtime ctx
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-rt-ctx
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-rt-ctx 2 3`mesh_ctx`, what a mesh program's init and task see: ids (node, warp, lane, thread, leader), block 4collectives, shared memory, scratch, the own view, peer views (gated by `reads`, read under the slot's 5seqlock), the program table (`find`, `prog_state`, `prog_name`, `request_run`), the input queue, pipes 6(`push_with`, `pop_with`, `pipe_free`, `pipe_len` over @ajax/mesh-abi-pipe with device atomics), the 7request window and `respond`, the lockstep exchange page, counters, the ticket, the system and group. 8 9| Rust | C | 10|---|---| 11| `ctx.view_u32(off)` | `mesh_ctx_view_u32(ctx, off)` | 12| `ctx.peer_view(s) -> Option<View>` | `bool mesh_ctx_peer_view(ctx, s, &view)` | 13| `ctx.find(b"train") -> Option<u32>` | `bool mesh_ctx_find(ctx, "train", 5, &slot)` | 14| `ctx.input_pop() -> Option<u8>` | `bool mesh_ctx_input_pop(ctx, &byte)` | 15| `ctx.push_with(s, \|v\| ..)` | `mesh_ctx_push_with(ctx, s, fill_fn, user)` | 16| `ctx.shared::<f32>(off, len)` | `bool mesh_ctx_shared(ctx, off, len, 4, &shared)` | 17| `ctx.for_strided(n, \|i\| ..)` | `MESH_CTX_FOR_STRIDED(ctx, n, i) { .. }` | 18| `ctx.group() -> Option<(u32, u32)>` | `bool mesh_ctx_group(ctx, &rank, &n)` | 19 20- **Ported from:** alpha-rust-mesh `crates/mesh-rt/src/ctx.rs`. 21- **Tests:** through the programs' simulator tests (views, peer views, input, pipes, requests, counters).