OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::singleton::MpiNonBlockingHelper Class Reference

Helper class for non blocking MPI communication. More...

#include <mpiManager.h>

+ Collaboration diagram for olb::singleton::MpiNonBlockingHelper:

Public Member Functions

 MpiNonBlockingHelper ()
 
 ~MpiNonBlockingHelper ()=default
 
 MpiNonBlockingHelper (MpiNonBlockingHelper &&rhs)=default
 
 MpiNonBlockingHelper (const MpiNonBlockingHelper &)=delete
 
MpiNonBlockingHelperoperator= (const MpiNonBlockingHelper &)=delete
 
void allocate (unsigned i)
 Allocates memory.
 
void free ()
 Reset.
 
unsigned get_size () const
 Returns the size of the vector _mpiRequest/_mpiStatus.
 
MPI_Request * get_mpiRequest (int i=0) const
 Get the specified request object.
 
MPI_Status * get_mpiStatus (int i=0) const
 Get the specified status object.
 
void start (int i)
 
void wait (int i)
 
bool isDone (int i)
 
void swap (MpiNonBlockingHelper &rhs)
 Swap method.
 

Detailed Description

Helper class for non blocking MPI communication.

Definition at line 51 of file mpiManager.h.

Constructor & Destructor Documentation

◆ MpiNonBlockingHelper() [1/3]

olb::singleton::MpiNonBlockingHelper::MpiNonBlockingHelper ( )

Definition at line 1312 of file mpiManager.cpp.

1312 :
1313 _size(0)
1314{ }

◆ ~MpiNonBlockingHelper()

olb::singleton::MpiNonBlockingHelper::~MpiNonBlockingHelper ( )
default

◆ MpiNonBlockingHelper() [2/3]

olb::singleton::MpiNonBlockingHelper::MpiNonBlockingHelper ( MpiNonBlockingHelper && rhs)
default

◆ MpiNonBlockingHelper() [3/3]

olb::singleton::MpiNonBlockingHelper::MpiNonBlockingHelper ( const MpiNonBlockingHelper & )
delete

Member Function Documentation

◆ allocate()

void olb::singleton::MpiNonBlockingHelper::allocate ( unsigned i)

Allocates memory.

Definition at line 1323 of file mpiManager.cpp.

1324{
1325 free();
1326 _mpiRequest.reset(new MPI_Request[n] { });
1327 _mpiStatus.reset(new MPI_Status[n] { });
1328 _size = n;
1329}

References free().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free()

void olb::singleton::MpiNonBlockingHelper::free ( )

Reset.

Definition at line 1331 of file mpiManager.cpp.

1332{
1333 _size = 0;
1334}
+ Here is the caller graph for this function:

◆ get_mpiRequest()

MPI_Request * olb::singleton::MpiNonBlockingHelper::get_mpiRequest ( int i = 0) const

Get the specified request object.

Definition at line 1341 of file mpiManager.cpp.

1342{
1343 OLB_PRECONDITION(size_t(i) < _size);
1344 return &_mpiRequest[i];
1345}
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References OLB_PRECONDITION.

+ Here is the caller graph for this function:

◆ get_mpiStatus()

MPI_Status * olb::singleton::MpiNonBlockingHelper::get_mpiStatus ( int i = 0) const

Get the specified status object.

Definition at line 1347 of file mpiManager.cpp.

1348{
1349 OLB_PRECONDITION(size_t(i) < _size);
1350 return &_mpiStatus[i];
1351}

References OLB_PRECONDITION.

+ Here is the caller graph for this function:

◆ get_size()

unsigned olb::singleton::MpiNonBlockingHelper::get_size ( ) const

Returns the size of the vector _mpiRequest/_mpiStatus.

Definition at line 1336 of file mpiManager.cpp.

1337{
1338 return _size;
1339}
+ Here is the caller graph for this function:

◆ isDone()

bool olb::singleton::MpiNonBlockingHelper::isDone ( int i)

Definition at line 1363 of file mpiManager.cpp.

1364{
1365 int done;
1366 MPI_Test(get_mpiRequest(i), &done, MPI_STATUS_IGNORE);
1367 return done;
1368}
MPI_Request * get_mpiRequest(int i=0) const
Get the specified request object.

References get_mpiRequest().

+ Here is the call graph for this function:

◆ operator=()

MpiNonBlockingHelper & olb::singleton::MpiNonBlockingHelper::operator= ( const MpiNonBlockingHelper & )
delete

◆ start()

void olb::singleton::MpiNonBlockingHelper::start ( int i)

Definition at line 1353 of file mpiManager.cpp.

1354{
1355 MPI_Start(get_mpiRequest(i));
1356}

References get_mpiRequest().

+ Here is the call graph for this function:

◆ swap()

void olb::singleton::MpiNonBlockingHelper::swap ( MpiNonBlockingHelper & rhs)

Swap method.

Definition at line 1316 of file mpiManager.cpp.

1317{
1318 std::swap(_size, rhs._size);
1319 std::swap(_mpiRequest, rhs._mpiRequest);
1320 std::swap(_mpiStatus, rhs._mpiStatus);
1321}

◆ wait()

void olb::singleton::MpiNonBlockingHelper::wait ( int i)

Definition at line 1358 of file mpiManager.cpp.

1359{
1360 MPI_Wait(get_mpiRequest(i), get_mpiStatus(i));
1361}
MPI_Status * get_mpiStatus(int i=0) const
Get the specified status object.

References get_mpiRequest(), and get_mpiStatus().

+ Here is the call graph for this function:

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