Expand description
§cobre-comm
Pluggable communication backend abstraction for the Cobre ecosystem.
This crate defines the Communicator and SharedMemoryProvider traits
that decouple distributed computations from specific communication technologies.
Backend implementations are feature-gated:
local— single-process no-op (always available, zero overhead)mpi— MPI collectives via ferrompitcp— TCP/IP coordinator pattern (no MPI required)shm— POSIX shared memory for single-node multi-process execution
The backend is selected at build time via Cargo feature flags, with optional
runtime override through the COBRE_COMM_BACKEND environment variable.
§Design principles
- Zero-cost static dispatch: generics over
Communicatoreliminate dynamic dispatch overhead on the hot path. - Additive features: multiple backends can coexist in one binary.
- Orthogonal to the solver: algorithm crates depend on this crate for communication; it does not depend back.
§Status
This crate is in early development. The API will change.
See the repository for the full roadmap.
Structs§
- Heap
Region - Shared memory region backed by a heap-allocated
Vec<T>. - Local
Backend - Single-process communication backend with identity collective semantics.
Enums§
- Backend
Error - Errors that can occur during backend selection and initialization.
- Backend
Kind - Programmatic backend selector for library-mode callers.
- Comm
Error - Errors that can occur during collective communication or shared memory operations.
- Reduce
Op - Element-wise reduction operations for
allreduce.
Traits§
- Comm
Data - Marker trait for types that can be transmitted through collective operations.
- Communicator
- Backend abstraction for collective communication operations.
- Local
Communicator - Object-safe sub-trait of
Communicatorfor intra-node initialization coordination. - Shared
Memory Provider - Backend abstraction for intra-node shared memory region management.
- Shared
Region - Handle to a shared memory region holding
countelements of typeT.
Functions§
- available_
backends - Returns all backend names compiled into this binary.
- create_
communicator - Construct the active communication backend (no-feature build).