jsmpi 0.1.0

A browser-oriented MPI compatibility layer for Rust/WASM using Web Workers
Documentation
use crate::error::Result;
use crate::runtime::Runtime;
use crate::topology::SystemCommunicator;

#[derive(Clone, Debug)]
pub struct Universe {
    runtime: Runtime,
}

impl Universe {
    pub(crate) fn new(runtime: Runtime) -> Self {
        Self { runtime }
    }

    pub fn world(&self) -> SystemCommunicator {
        SystemCommunicator::new(self.runtime.clone())
    }
}

pub fn initialize() -> Result<Universe> {
    let runtime = Runtime::detect()?;
    Ok(Universe::new(runtime))
}