Loading [MathJax]/extensions/tex2jax.js
KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros
mpi_data_communicator.h File Reference
#include <string>
#include <iostream>
#include <mpi.h>
#include "includes/define.h"
#include "includes/data_communicator.h"
Include dependency graph for mpi_data_communicator.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Kratos::MPIDataCommunicator
 Wrapper for common MPI calls within Kratos. More...
 

Namespaces

 Kratos
 REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
 

Macros

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SYNC_SHAPE_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_REDUCE_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_LOC_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCANSUM_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SENDRECV_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_BROADCAST_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCATTER_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_GATHER_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_PUBLIC_INTERFACE_FOR_TYPE(...)
 
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_IMPLEMENTATION_FOR_TYPE(...)
 

Functions

Input and output
std::istream & Kratos::operator>> (std::istream &rIStream, MPIDataCommunicator &rThis)
 input stream function More...
 
std::ostream & Kratos::operator<< (std::ostream &rOStream, const MPIDataCommunicator &rThis)
 output stream function More...
 

Macro Definition Documentation

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_INTERFACE_FOR_TYPE (   ...)
Value:
__VA_ARGS__ SumAll(const __VA_ARGS__& rLocalValue) const override; \
std::vector<__VA_ARGS__> SumAll(const std::vector<__VA_ARGS__>& rLocalValues) const override; \
void SumAll(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues) const override; \
__VA_ARGS__ MinAll(const __VA_ARGS__& rLocalValue) const override; \
std::vector<__VA_ARGS__> MinAll(const std::vector<__VA_ARGS__>& rLocalValues) const override; \
void MinAll(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues) const override; \
__VA_ARGS__ MaxAll(const __VA_ARGS__& rLocalValue) const override; \
std::vector<__VA_ARGS__> MaxAll(const std::vector<__VA_ARGS__>& rLocalValues) const override; \
void MaxAll(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues) const override; \

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_LOC_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_LOC_INTERFACE_FOR_TYPE (   ...)
Value:
std::pair<__VA_ARGS__, int> MinLocAll(const __VA_ARGS__& rLocalValue) const override; \
std::pair<__VA_ARGS__, int> MaxLocAll(const __VA_ARGS__& rLocalValue) const override;

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_BROADCAST_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_BROADCAST_INTERFACE_FOR_TYPE (   ...)
Value:
void BroadcastImpl(__VA_ARGS__& rBuffer, const int SourceRank) const override; \
void BroadcastImpl(std::vector<__VA_ARGS__>& rBuffer, const int SourceRank) const override; \

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_GATHER_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_GATHER_INTERFACE_FOR_TYPE (   ...)
Value:
std::vector<__VA_ARGS__> Gather(const std::vector<__VA_ARGS__>& rSendValues, const int DestinationRank) const override; \
void Gather( \
const std::vector<__VA_ARGS__>& rSendValues, std::vector<__VA_ARGS__>& rRecvValues, \
const int DestinationRank) const override; \
std::vector<std::vector<__VA_ARGS__>> Gatherv( \
const std::vector<__VA_ARGS__>& rSendValues, const int DestinationRank) const override; \
void Gatherv(const std::vector<__VA_ARGS__>& rSendValues, \
std::vector<__VA_ARGS__>& rRecvValues, \
const std::vector<int>& rRecvCounts, \
const std::vector<int>& rRecvOffsets, \
const int DestinationRank) const override; \
std::vector<__VA_ARGS__> AllGather(const std::vector<__VA_ARGS__>& rSendValues) const override; \
void AllGather(const std::vector<__VA_ARGS__>& rSendValues, std::vector<__VA_ARGS__>& rRecvValues) const override; \
std::vector<std::vector<__VA_ARGS__>> AllGatherv(const std::vector<__VA_ARGS__>& rSendValues) const override; \
void AllGatherv(const std::vector<__VA_ARGS__>& rSendValues, std::vector<__VA_ARGS__>& rRecvValues, \
const std::vector<int>& rRecvCounts, const std::vector<int>& rRecvOffsets) const override;

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_IMPLEMENTATION_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_IMPLEMENTATION_FOR_TYPE (   ...)
Value:
KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_BROADCAST_INTERFACE_FOR_TYPE(__VA_ARGS__) \
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SENDRECV_INTERFACE_FOR_TYPE(...)
Definition: mpi_data_communicator.h:78

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_PUBLIC_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_PUBLIC_INTERFACE_FOR_TYPE (   ...)
Value:
KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_ALLREDUCE_INTERFACE_FOR_TYPE(__VA_ARGS__) \
KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCANSUM_INTERFACE_FOR_TYPE(__VA_ARGS__) \
KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCATTER_INTERFACE_FOR_TYPE(__VA_ARGS__) \
KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_GATHER_INTERFACE_FOR_TYPE(__VA_ARGS__) \
KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SYNC_SHAPE_INTERFACE_FOR_TYPE(__VA_ARGS__) \
#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_REDUCE_INTERFACE_FOR_TYPE(...)
Definition: mpi_data_communicator.h:36

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_REDUCE_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_REDUCE_INTERFACE_FOR_TYPE (   ...)
Value:
__VA_ARGS__ Sum(const __VA_ARGS__& rLocalValue, const int Root) const override; \
std::vector<__VA_ARGS__> Sum(const std::vector<__VA_ARGS__>& rLocalValues, const int Root) const override; \
void Sum(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues, const int Root) const override; \
__VA_ARGS__ Min(const __VA_ARGS__& rLocalValue, const int Root) const override; \
std::vector<__VA_ARGS__> Min(const std::vector<__VA_ARGS__>& rLocalValues, const int Root) const override; \
void Min(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues, const int Root) const override; \
__VA_ARGS__ Max(const __VA_ARGS__& rLocalValue, const int Root) const override; \
std::vector<__VA_ARGS__> Max(const std::vector<__VA_ARGS__>& rLocalValues, const int Root) const override; \
void Max(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues, const int Root) const override; \

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCANSUM_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCANSUM_INTERFACE_FOR_TYPE (   ...)
Value:
__VA_ARGS__ ScanSum(const __VA_ARGS__& rLocalValue) const override; \
std::vector<__VA_ARGS__> ScanSum(const std::vector<__VA_ARGS__>& rLocalValues) const override; \
void ScanSum(const std::vector<__VA_ARGS__>& rLocalValues, std::vector<__VA_ARGS__>& rGlobalValues) const override; \

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCATTER_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SCATTER_INTERFACE_FOR_TYPE (   ...)
Value:
std::vector<__VA_ARGS__> Scatter( \
const std::vector<__VA_ARGS__>& rSendValues, const int SourceRank) const override; \
void Scatter( \
const std::vector<__VA_ARGS__>& rSendValues, std::vector<__VA_ARGS__>& rRecvValues, \
const int SourceRank) const override; \
std::vector<__VA_ARGS__> Scatterv( \
const std::vector<std::vector<__VA_ARGS__>>& rSendValues, const int SourceRank) const override; \
void Scatterv( \
const std::vector<__VA_ARGS__>& rSendValues, \
const std::vector<int>& rSendCounts, const std::vector<int>& rSendOffsets, \
std::vector<__VA_ARGS__>& rRecvValues, const int SourceRank) const override; \

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SENDRECV_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SENDRECV_INTERFACE_FOR_TYPE (   ...)
Value:
__VA_ARGS__ SendRecvImpl( \
const __VA_ARGS__& SendValue, const int SendDestination, const int SendTag, \
const int RecvSource, const int RecvTag) const override; \
std::vector<__VA_ARGS__> SendRecvImpl(const std::vector<__VA_ARGS__>& rSendValues, \
const int SendDestination, const int SendTag, \
const int RecvSource, const int RecvTag) const override; \
void SendRecvImpl( \
const __VA_ARGS__& SendValue, const int SendDestination, const int SendTag, \
__VA_ARGS__& RecvValue, const int RecvSource, const int RecvTag) const override; \
void SendRecvImpl( \
const std::vector<__VA_ARGS__>& rSendValues, const int SendDestination, const int SendTag, \
std::vector<__VA_ARGS__>& rRecvValues, const int RecvSource, const int RecvTag) const override; \
void SendImpl(const __VA_ARGS__& rSendValues, \
const int SendDestination, const int SendTag = 0) const override; \
void SendImpl(const std::vector<__VA_ARGS__>& rSendValues, \
const int SendDestination, const int SendTag = 0) const override; \
void RecvImpl(__VA_ARGS__& rRecvValues, \
const int RecvSource, const int RecvTag = 0) const override; \
void RecvImpl(std::vector<__VA_ARGS__>& rRecvValues, \
const int RecvSource, const int RecvTag = 0) const override; \

◆ KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SYNC_SHAPE_INTERFACE_FOR_TYPE

#define KRATOS_MPI_DATA_COMMUNICATOR_DECLARE_SYNC_SHAPE_INTERFACE_FOR_TYPE (   ...)
Value:
bool SynchronizeShape(__VA_ARGS__&) const override; \
bool SynchronizeShape( \
const __VA_ARGS__& rSendValue, const int SendDestination, const int SendTag, \
__VA_ARGS__& rRecvValue, const int RecvSource, const int RecvTag) const override; \