local_host_mesh

Function local_host_mesh 

Source
pub async fn local_host_mesh(n: usize) -> HostMesh
Expand description

Create a local in-process host mesh with n hosts, all running in the current process using Local channel transport.

This is similar to HostMesh::local_in_process but supports multiple hosts. All hosts use [LocalProcManager] with ChannelTransport::Local, so there is no IPC overhead.

§Examples

let mut host_mesh = test_utils::local_host_mesh(4).await;
let proc_mesh = host_mesh
    .spawn(instance, "test", ndslice::extent!(gpu = 8))
    .await
    .unwrap();
// ... do something with the proc mesh ...
// shutdown the host mesh.
let _ = host_mesh.shutdown(&instance).await;