Skip to main content

pmap

Function pmap 

Source
pub fn pmap<C, T, U, E, F>(
    world: &C,
    domain: &Domain,
    options: PmapOptions,
    root_items: Option<Vec<T>>,
    f: F,
) -> Result<Option<Vec<U>>, PmapError>
where C: Communicator, T: Serialize + DeserializeOwned + Send, U: Serialize + DeserializeOwned + Send, E: Display + Send, F: Fn(T) -> Result<U, E> + Send + Sync,
Expand description

Dynamically maps root-owned items across MPI ranks and each rank’s explicit Rayon domain.

Every rank must call this collective in the same order with identical options. Only options.root supplies items and receives ordered results. The call must originate on the MPI initialization/main thread outside every Rayon worker, and MPI must provide MPI_THREAD_FUNNELED or stronger. Callback state may borrow non-'static data while satisfying the stated Rayon Send/Sync bounds; values retain the serialization bounds required by remote execution. All MPI calls remain on the calling thread. When PmapOptions::prefetch is true, each remote domain may hold one additional batch so blocking task/result transfer overlaps adjacent callback execution; the root domain remains capacity one.