Function mpi::request::scope [] [src]

pub fn scope<'a, F, R>(f: F) -> R where
    F: FnOnce(&LocalScope<'a>) -> R, 

Used to create a LocalScope

The function creates a LocalScope and then passes it into the given closure as an argument.

For safety reasons, all variables and buffers associated with a request must exist outside the scope with which the request is registered.

It is typically used like this:

/* declare variables and buffers here ... */
mpi::request::scope(|scope| {
    /* perform sends and/or receives using 'scope' */
});
/* at end of scope, panic if there are requests that have not yet completed */

Examples

See examples/immediate.rs