DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::MPI::CommStrategy Class Reference

Process-wide singleton that selects how ArrayTransformer packs and waits for MPI messages. More...

#include <MPI.hpp>

Public Types

enum  ArrayCommType { UnknownArrayCommType = 0 , HIndexed = 1 , InSituPack = 2 }
 Which derived-type strategy ArrayTransformer should use. More...
 

Public Member Functions

 CommStrategy (const CommStrategy &)=delete
 
CommStrategyoperator= (const CommStrategy &)=delete
 
 CommStrategy (CommStrategy &&)=delete
 
CommStrategyoperator= (CommStrategy &&)=delete
 
 ~CommStrategy ()=default
 
ArrayCommType GetArrayStrategy ()
 Current array-pack strategy.
 
void SetArrayStrategy (ArrayCommType t)
 Override the array-pack strategy (affects subsequently-created transformers).
 
bool GetUseStrongSyncWait () const
 Whether barriers are inserted around Waitall for profiling.
 
bool GetUseAsyncOneByOne () const
 Whether transformers should use one-by-one Isend/Irecv.
 
double GetUseLazyWait () const
 Polling interval (ns) for MPI::WaitallLazy. 0 means use MPI_Waitall.
 

Static Public Member Functions

static CommStrategyInstance ()
 Access the process-wide singleton.
 

Static Public Attributes

static const int Ntype = 10
 

Detailed Description

Process-wide singleton that selects how ArrayTransformer packs and waits for MPI messages.

Settings affect every transformer:

  • ArrayCommType: HIndexed (default: MPI_Type_create_hindexed derived types) vs InSituPack (manual memcpy into contiguous send/recv buffers). The latter can be faster on networks where derived types pay large unpacking overhead.
  • UseStrongSyncWait: insert barriers around wait calls for easier profiling.
  • UseAsyncOneByOne: issue per-peer Isend/ Irecv instead of one persistent Startall.
  • UseLazyWait: poll interval (ns) used by MPI::WaitallLazy.

Must be constructed under MPI_COMM_WORLD. Thread-safe C++11 singleton.

Definition at line 779 of file MPI.hpp.

Member Enumeration Documentation

◆ ArrayCommType

Which derived-type strategy ArrayTransformer should use.

Enumerator
UnknownArrayCommType 

Sentinel / uninitialised.

HIndexed 

Use MPI_Type_create_hindexed derived types (default).

InSituPack 

Manually pack / unpack into contiguous buffers.

Definition at line 783 of file MPI.hpp.

Constructor & Destructor Documentation

◆ CommStrategy() [1/2]

DNDS::MPI::CommStrategy::CommStrategy ( const CommStrategy )
delete

◆ CommStrategy() [2/2]

DNDS::MPI::CommStrategy::CommStrategy ( CommStrategy &&  )
delete

◆ ~CommStrategy()

DNDS::MPI::CommStrategy::~CommStrategy ( )
default

Member Function Documentation

◆ GetArrayStrategy()

CommStrategy::ArrayCommType DNDS::MPI::CommStrategy::GetArrayStrategy ( )

Current array-pack strategy.

Definition at line 440 of file MPI.cpp.

Here is the caller graph for this function:

◆ GetUseAsyncOneByOne()

bool DNDS::MPI::CommStrategy::GetUseAsyncOneByOne ( ) const

Whether transformers should use one-by-one Isend/Irecv.

Definition at line 455 of file MPI.cpp.

◆ GetUseLazyWait()

double DNDS::MPI::CommStrategy::GetUseLazyWait ( ) const

Polling interval (ns) for MPI::WaitallLazy. 0 means use MPI_Waitall.

Definition at line 460 of file MPI.cpp.

◆ GetUseStrongSyncWait()

bool DNDS::MPI::CommStrategy::GetUseStrongSyncWait ( ) const

Whether barriers are inserted around Waitall for profiling.

Definition at line 450 of file MPI.cpp.

◆ Instance()

CommStrategy & DNDS::MPI::CommStrategy::Instance ( )
static

Access the process-wide singleton.

Definition at line 434 of file MPI.cpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

CommStrategy & DNDS::MPI::CommStrategy::operator= ( CommStrategy &&  )
delete

◆ operator=() [2/2]

CommStrategy & DNDS::MPI::CommStrategy::operator= ( const CommStrategy )
delete

◆ SetArrayStrategy()

void DNDS::MPI::CommStrategy::SetArrayStrategy ( CommStrategy::ArrayCommType  t)

Override the array-pack strategy (affects subsequently-created transformers).

Definition at line 445 of file MPI.cpp.

Member Data Documentation

◆ Ntype

const int DNDS::MPI::CommStrategy::Ntype = 10
static

Definition at line 790 of file MPI.hpp.


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