Module mpi::request [] [src]

Request objects for non-blocking operations

Non-blocking operations such as immediate_send() return request objects that borrow any buffers involved in the operation so as to ensure proper access restrictions. In order to release the borrowed buffers from the request objects, a completion operation such as wait() or test() must be used on the request object.

Note: If the Request is dropped (as opposed to calling wait or test explicitly), the program will panic.

To enforce this rule, every request object must be registered to some pre-existing Scope. At the end of a Scope, all its remaining requests will be waited for until completion. Scopes can be created using either scope or StaticScope.

To handle request completion in an RAII style, a request can be wrapped in either WaitGuard or CancelGuard, which will follow the respective policy for completing the operation. When the guard is dropped, the request will be automatically unregistered from its Scope.

Unfinished features

Structs

CancelGuard

Guard object that tries to cancel and waits for the completion of an operation when it is dropped

LocalScope

A temporary scope that lasts no more than the lifetime 'a

Request

A request object for a non-blocking operation registered with a Scope of lifetime 'a

StaticScope

The scope that lasts as long as the entire execution of the program

WaitGuard

Guard object that waits for the completion of an operation when it is dropped

Traits

Scope

A common interface for LocalScope and StaticScope used internally by the request module.

Functions

scope

Used to create a LocalScope