preCICE v3.2.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | Static Private Attributes | List of all members
precice::utils::IntraComm Class Reference

Utility class for managing intra-participant communication operations. More...

#include <IntraComm.hpp>

Collaboration diagram for precice::utils::IntraComm:
[legend]

Static Public Member Functions

static void configure (Rank rank, int size)
 Configures the intra-participant communication.
 
static Rank getRank ()
 Current rank.
 
static int getSize ()
 Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.
 
static com::PtrCommunicationgetCommunication ()
 Intra-participant communication.
 
static auto allSecondaryRanks ()
 Returns an iterable range over salve ranks [1, _size)
 
static auto allRanks ()
 Returns an iterable range over all ranks [0, _size)
 
static bool isPrimary ()
 True if this process is running the primary rank.
 
static bool isSecondary ()
 True if this process is running a secondary rank.
 
static bool isParallel ()
 True if this process is running in parallel.
 
static double l2norm (const Eigen::VectorXd &vec)
 The l2 norm of a vector is calculated on distributed data.
 
static double dot (const Eigen::VectorXd &vec1, const Eigen::VectorXd &vec2)
 
static void reset ()
 
static void reduceSum (precice::span< const double > sendData, precice::span< double > rcvData)
 
static void reduceSum (const int &sendData, int &rcvData)
 
static void reduceSum (const double &sendData, double &rcvData)
 
static void allreduceSum (precice::span< const double > sendData, precice::span< double > rcvData)
 
static void allreduceSum (double &sendData, double &rcvData)
 
static void allreduceSum (int &sendData, int &rcvData)
 
static void broadcast (bool &value)
 
static void broadcast (double &value)
 
static void broadcast (int &value)
 
static void broadcast (precice::span< double > values)
 
static void synchronize ()
 
static bool willSynchronize ()
 
static void barrier ()
 Synchronizes all ranks.
 

Static Private Attributes

static logging::Logger _log
 
static Rank _rank = -1
 Current rank.
 
static int _size = -1
 Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.
 
static bool _isPrimaryRank = false
 True if this process is running the primary rank.
 
static bool _isSecondaryRank = false
 True if this process is running a secondary rank.
 
static com::PtrCommunication _communication
 Intra-participant communication.
 

Detailed Description

Utility class for managing intra-participant communication operations.

Definition at line 19 of file IntraComm.hpp.

Member Function Documentation

◆ allRanks()

static auto precice::utils::IntraComm::allRanks ( )
inlinestatic

Returns an iterable range over all ranks [0, _size)

Definition at line 43 of file IntraComm.hpp.

◆ allreduceSum() [1/3]

void precice::utils::IntraComm::allreduceSum ( double & sendData,
double & rcvData )
static

Definition at line 225 of file IntraComm.cpp.

Here is the call graph for this function:

◆ allreduceSum() [2/3]

void precice::utils::IntraComm::allreduceSum ( int & sendData,
int & rcvData )
static

Definition at line 248 of file IntraComm.cpp.

Here is the call graph for this function:

◆ allreduceSum() [3/3]

void precice::utils::IntraComm::allreduceSum ( precice::span< const double > sendData,
precice::span< double > rcvData )
static

Definition at line 202 of file IntraComm.cpp.

Here is the call graph for this function:

◆ allSecondaryRanks()

static auto precice::utils::IntraComm::allSecondaryRanks ( )
inlinestatic

Returns an iterable range over salve ranks [1, _size)

Definition at line 37 of file IntraComm.hpp.

◆ barrier()

void precice::utils::IntraComm::barrier ( )
static

Synchronizes all ranks.

Definition at line 373 of file IntraComm.cpp.

Here is the call graph for this function:

◆ broadcast() [1/4]

void precice::utils::IntraComm::broadcast ( bool & value)
static

Definition at line 293 of file IntraComm.cpp.

Here is the call graph for this function:

◆ broadcast() [2/4]

void precice::utils::IntraComm::broadcast ( double & value)
static

Definition at line 315 of file IntraComm.cpp.

Here is the call graph for this function:

◆ broadcast() [3/4]

void precice::utils::IntraComm::broadcast ( int & value)
static

Definition at line 337 of file IntraComm.cpp.

Here is the call graph for this function:

◆ broadcast() [4/4]

void precice::utils::IntraComm::broadcast ( precice::span< double > values)
static

Definition at line 271 of file IntraComm.cpp.

Here is the call graph for this function:

◆ configure()

void precice::utils::IntraComm::configure ( Rank rank,
int size )
static

Configures the intra-participant communication.

Definition at line 31 of file IntraComm.cpp.

◆ dot()

double precice::utils::IntraComm::dot ( const Eigen::VectorXd & vec1,
const Eigen::VectorXd & vec2 )
static

Definition at line 102 of file IntraComm.cpp.

Here is the call graph for this function:

◆ getCommunication()

static com::PtrCommunication & precice::utils::IntraComm::getCommunication ( )
inlinestatic

Intra-participant communication.

Definition at line 31 of file IntraComm.hpp.

◆ getRank()

Rank precice::utils::IntraComm::getRank ( )
static

Current rank.

Definition at line 42 of file IntraComm.cpp.

◆ getSize()

int precice::utils::IntraComm::getSize ( )
static

Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.

Definition at line 47 of file IntraComm.cpp.

◆ isParallel()

bool precice::utils::IntraComm::isParallel ( )
static

True if this process is running in parallel.

Definition at line 62 of file IntraComm.cpp.

◆ isPrimary()

bool precice::utils::IntraComm::isPrimary ( )
static

True if this process is running the primary rank.

Definition at line 52 of file IntraComm.cpp.

◆ isSecondary()

bool precice::utils::IntraComm::isSecondary ( )
static

True if this process is running a secondary rank.

Definition at line 57 of file IntraComm.cpp.

◆ l2norm()

double precice::utils::IntraComm::l2norm ( const Eigen::VectorXd & vec)
static

The l2 norm of a vector is calculated on distributed data.

Definition at line 67 of file IntraComm.cpp.

Here is the call graph for this function:

◆ reduceSum() [1/3]

void precice::utils::IntraComm::reduceSum ( const double & sendData,
double & rcvData )
static

Definition at line 172 of file IntraComm.cpp.

Here is the call graph for this function:

◆ reduceSum() [2/3]

void precice::utils::IntraComm::reduceSum ( const int & sendData,
int & rcvData )
static

Definition at line 179 of file IntraComm.cpp.

Here is the call graph for this function:

◆ reduceSum() [3/3]

void precice::utils::IntraComm::reduceSum ( precice::span< const double > sendData,
precice::span< double > rcvData )
static

Definition at line 149 of file IntraComm.cpp.

Here is the call graph for this function:

◆ reset()

void precice::utils::IntraComm::reset ( )
static

Definition at line 140 of file IntraComm.cpp.

◆ synchronize()

void precice::utils::IntraComm::synchronize ( )
static

Synchronizes all ranks if syncMode is enabled

See also
precice::syncMode
barrier()

Definition at line 359 of file IntraComm.cpp.

Here is the call graph for this function:

◆ willSynchronize()

bool precice::utils::IntraComm::willSynchronize ( )
static

Does @synchronize have an effect?

See also
precice::syncMode

Definition at line 368 of file IntraComm.cpp.

Member Data Documentation

◆ _communication

com::PtrCommunication precice::utils::IntraComm::_communication
staticprivate

Intra-participant communication.

Definition at line 115 of file IntraComm.hpp.

◆ _isPrimaryRank

bool precice::utils::IntraComm::_isPrimaryRank = false
staticprivate

True if this process is running the primary rank.

Definition at line 109 of file IntraComm.hpp.

◆ _isSecondaryRank

bool precice::utils::IntraComm::_isSecondaryRank = false
staticprivate

True if this process is running a secondary rank.

Definition at line 112 of file IntraComm.hpp.

◆ _log

logging::Logger precice::utils::IntraComm::_log
staticprivate

Definition at line 100 of file IntraComm.hpp.

◆ _rank

Rank precice::utils::IntraComm::_rank = -1
staticprivate

Current rank.

Definition at line 103 of file IntraComm.hpp.

◆ _size

int precice::utils::IntraComm::_size = -1
staticprivate

Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.

Definition at line 106 of file IntraComm.hpp.


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