FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Dist::Request Class Reference

Communication Request class. More...

#include <dist.hpp>

Public Member Functions

 Request ()
 Standard constructor. More...
 
 Request (const Request &)=delete
 Request objects are non-copyable.
 
 Request (MPI_Request req_)
 MPI_Request constructor. More...
 
 Request (Request &&other)
 Move constructor. More...
 
 ~Request ()
 non-virtual destructor More...
 
void cancel ()
 Cancels the request. More...
 
void free ()
 Frees the request. More...
 
bool is_null () const
 Checks whether this request is null. More...
 
MPI_Request * mpi_request ()
 
Request & operator= (const Request &)=delete
 Request objects are non-copyable.
 
Request & operator= (Request &&other)
 Move-assignment operator. More...
 
bool test ()
 Tests whether the request is fulfilled (or null). More...
 
bool test (Status &status)
 Tests whether the request is fulfilled (or null) without blocking. More...
 
bool wait ()
 Blocks until the request is fulfilled (or null). More...
 
bool wait (Status &status)
 Blocks until the request is fulfilled (or null). More...
 

Public Attributes

MPI_Request request
 our internal MPI request handle More...
 

Detailed Description

Communication Request class.

This class effectively wraps around the MPI_Request handle.

This class is move-constructible and move-assignable, but objects of this class are non-copyable.

Warning
This class intentionally does not free the internal MPI request upon destruction!
If you really want to free the request without waiting for it, you have to do so manually by calling the free() member function!
Attention
This class is assumed to be a POD container for MPI_Request, i.e. you must not add any other member variables or virtual functions to this class!
See also
[MPI31] Section 3.7
Author
Peter Zajac

Definition at line 730 of file dist.hpp.

Constructor & Destructor Documentation

◆ Request() [1/3]

FEAT::Dist::Request::Request ( )

Standard constructor.

This constructor creates a (valid) null request, i.e. a request which is already fulfilled.

Definition at line 221 of file dist.cpp.

◆ Request() [2/3]

FEAT::Dist::Request::Request ( MPI_Request  req_)
explicit

MPI_Request constructor.

Definition at line 226 of file dist.cpp.

◆ Request() [3/3]

FEAT::Dist::Request::Request ( Request &&  other)

Move constructor.

This constructor moves the input request into the newly constructed request and sets the input request other to a null request.

Parameters
[in,out]otherThe request that is to be moved.

Definition at line 231 of file dist.cpp.

◆ ~Request()

FEAT::Dist::Request::~Request ( )
inline

non-virtual destructor

Definition at line 796 of file dist.hpp.

References is_null(), and XASSERTM.

Member Function Documentation

◆ cancel()

void FEAT::Dist::Request::cancel ( )

Cancels the request.

This function effectively calls MPI_Cancel() for the internal MPI_Request handle.

Note
This function does nothing if the request is already null.
Attention
This function does no free the request!
See also
[MPI31] Section 3.8.4, page 71

Definition at line 259 of file dist.cpp.

References request.

◆ free()

void FEAT::Dist::Request::free ( )

Frees the request.

This function effectively calls MPI_Request_free() for the internal MPI_Request handle.

Note
This function does nothing if the request is already null.
See also
[MPI31] Section 3.7.3, page 55

Definition at line 253 of file dist.cpp.

References request.

◆ is_null()

bool FEAT::Dist::Request::is_null ( ) const

Checks whether this request is null.

This function effectively checks whether the internal MPI_Request handle is equal to MPI_REQUEST_NULL.

Returns
true, if this request is null, otherwise false.
See also
[MPI31] Section 3.7.3, page 52

Definition at line 248 of file dist.cpp.

References request.

Referenced by ~Request(), and operator=().

◆ mpi_request()

MPI_Request * FEAT::Dist::Request::mpi_request ( )
inline
Returns
A pointer to the internal MPI_Request handle.

Definition at line 756 of file dist.hpp.

References request.

◆ operator=()

Request & FEAT::Dist::Request::operator= ( Request &&  other)

Move-assignment operator.

This operator moves the input request into this request object and sets the input request other to a null request.

Attention
The destination request represented by this must be a null request, as this operator will fire an assertion failure otherwise!
Parameters
[in,out]otherThe request that is to be moved.
Returns
*this.

Definition at line 237 of file dist.cpp.

References is_null(), request, and XASSERT.

◆ test() [1/2]

bool FEAT::Dist::Request::test ( )
inline

Tests whether the request is fulfilled (or null).

This function calls test(Status&) and discards the status object.

Returns
true, if the request is fulfilled (or null), or false, if the request is still active.

Definition at line 864 of file dist.hpp.

References test().

Referenced by test().

◆ test() [2/2]

bool FEAT::Dist::Request::test ( Status &  status)

Tests whether the request is fulfilled (or null) without blocking.

This function effectively calls MPI_Test() for the internal MPI_Request handle.

Note
For a null request, this function returns true, but leaves the status argument unmodified.
Parameters
[out]statusA reference to the Status object that receives information about the request, if it was fulfilled by this call.
Returns
true, if the request is fulfilled (or null), or false, if the request is still active.
See also
[MPI31] Section 3.7.3, page 54

Definition at line 265 of file dist.cpp.

References FEAT::Dist::Status::mpi_status(), and request.

Referenced by FEAT::Dist::RequestVector::test_for().

◆ wait() [1/2]

bool FEAT::Dist::Request::wait ( )
inline

Blocks until the request is fulfilled (or null).

This function calls wait(Status&) and discards the status object.

Returns
true, if the request was fulfilled by this call, or false, if the request was already null prior to this call.

Definition at line 896 of file dist.hpp.

References wait().

Referenced by wait().

◆ wait() [2/2]

bool FEAT::Dist::Request::wait ( Status &  status)

Blocks until the request is fulfilled (or null).

This function effectively calls MPI_Wait() for the internal MPI_Request handle.

Parameters
[out]statusA reference to the Status object that receives information about the request, if it was fulfilled by this call.
Returns
true, if the request was fulfilled by this call, or false, if the request was already null prior to this call.
See also
[MPI31] Section 3.7.3, page 53

Definition at line 272 of file dist.cpp.

References FEAT::Dist::Status::mpi_status(), and request.

Referenced by FEAT::Global::SynchScalarTicket< DT_ >::wait(), and FEAT::Dist::RequestVector::wait_for().

Member Data Documentation

◆ request

MPI_Request FEAT::Dist::Request::request

our internal MPI request handle

Definition at line 735 of file dist.hpp.

Referenced by cancel(), free(), is_null(), mpi_request(), operator=(), test(), and wait().


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