5#include "boost/range/irange.hpp"
39 return boost::irange(1,
_size);
45 return boost::irange(0,
_size);
58 static double l2norm(
const Eigen::VectorXd &vec);
61 static double dot(
const Eigen::VectorXd &vec1,
const Eigen::VectorXd &vec2);
67 static void reduceSum(
const int &sendData,
int &rcvData);
69 static void reduceSum(
const double &sendData,
double &rcvData);
73 static void allreduceSum(
double &sendData,
double &rcvData);
This class provides a lightweight logger.
A C++ 11 implementation of the non-owning C++20 std::span type.
Utility class for managing intra-participant communication operations.
static bool _isPrimaryRank
True if this process is running the primary rank.
static void barrier()
Synchronizes all ranks.
static void allreduceSum(precice::span< const double > sendData, precice::span< double > rcvData)
static bool _isSecondaryRank
True if this process is running a secondary rank.
static int _size
Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.
static int getSize()
Number of ranks. This includes ranks from both participants, e.g. minimal size is 2.
static double l2norm(const Eigen::VectorXd &vec)
The l2 norm of a vector is calculated on distributed data.
static Rank getRank()
Current rank.
static double dot(const Eigen::VectorXd &vec1, const Eigen::VectorXd &vec2)
static bool isPrimary()
True if this process is running the primary rank.
static void broadcast(bool &value)
static auto allSecondaryRanks()
Returns an iterable range over salve ranks [1, _size)
static com::PtrCommunication _communication
Intra-participant communication.
static Rank _rank
Current rank.
static auto allRanks()
Returns an iterable range over all ranks [0, _size)
static bool isParallel()
True if this process is running in parallel.
static void synchronize()
static bool isSecondary()
True if this process is running a secondary rank.
static logging::Logger _log
static com::PtrCommunication & getCommunication()
Intra-participant communication.
static void configure(Rank rank, int size)
Configures the intra-participant communication.
static void reduceSum(precice::span< const double > sendData, precice::span< double > rcvData)
Main namespace of the precice library.