DOLFINx 0.12.0.0
DOLFINx C++
Loading...
Searching...
No Matches
Request Class Reference

Holder for the request of a non-blocking operation. More...

#include <MPI.h>

Public Member Functions

 Request ()=default
 Create a null request.
 Request (const Request &) noexcept
 Copy constructor. The copy has no request in flight.
 Request (Request &&request) noexcept
 Move constructor.
 ~Request ()=default
 Destructor.
Request & operator= (const Request &) noexcept
 Copy assignment. Leaves this with no request in flight.
Request & operator= (Request &&request) noexcept
 Move assignment.
MPI_Request & request () noexcept
 The handle to pass to MPI.
const MPI_Request & request () const noexcept
 The handle.

Detailed Description

Holder for the request of a non-blocking operation.

MPI_Request is a plain handle, so a class storing one bare cannot use a defaulted move: the moved-from object would be left naming the same request as the target. This holder transfers the request on move and leaves the source null, which keeps the owner's own move operations = default and correct as members are added.

Copying does not transfer a request in flight – the new request is null – so a copied owner does not wait on an operation it did not start. The owner's copy operations therefore stay usable.

Note
Nothing is released on destruction. A request is consumed by the MPI_Wait that completes it, which the owner is responsible for.

Member Function Documentation

◆ request() [1/2]

const MPI_Request & request ( ) const
inlinenoexcept

The handle.

Returns
Request, MPI_REQUEST_NULL if no operation is in flight.

◆ request() [2/2]

MPI_Request & request ( )
inlinenoexcept

The handle to pass to MPI.

Returns
Request, MPI_REQUEST_NULL if no operation is in flight.

The documentation for this class was generated from the following file: