virtual std::vector<__VA_ARGS__> Scatter(const std::vector<__VA_ARGS__>& rSendValues, const int SourceRank) const { \
KRATOS_ERROR_IF( Rank() != SourceRank ) \
<< "Communication between different ranks is not possible with a serial DataCommunicator." << std::endl; \
return rSendValues; \
} \
virtual void Scatter( \
const std::vector<__VA_ARGS__>& rSendValues, std::vector<__VA_ARGS__>& rRecvValues, const int SourceRank) const { \
KRATOS_DATA_COMMUNICATOR_DEBUG_SIZE_CHECK(rSendValues.size(),rRecvValues.size(),"Scatter"); \
rRecvValues = Scatter(rSendValues, SourceRank); \
} \
virtual std::vector<__VA_ARGS__> Scatterv(const std::vector<std::vector<__VA_ARGS__>>& rSendValues, const int SourceRank) const { \
KRATOS_ERROR_IF( Rank() != SourceRank ) \
<< "Communication between different ranks is not possible with a serial DataCommunicator." << std::endl; \
KRATOS_ERROR_IF(
static_cast<unsigned int>(
Size()) != rSendValues.size() ) \
<< "Unexpected number of sends in DataCommuncatior::Scatterv (serial DataCommunicator always assumes a single process)." << std::endl; \
return rSendValues[0]; \
} \
virtual 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 { \
KRATOS_DATA_COMMUNICATOR_DEBUG_SIZE_CHECK(rRecvValues.size(), rSendValues.size(), "Scatterv (values check)"); \
KRATOS_DATA_COMMUNICATOR_DEBUG_SIZE_CHECK(rSendCounts.size(), 1, "Scatterv (counts check)"); \
KRATOS_DATA_COMMUNICATOR_DEBUG_SIZE_CHECK(rSendOffsets.size(), 1, "Scatterv (offsets check)"); \
KRATOS_ERROR_IF( Rank() != SourceRank ) \
<< "Communication between different ranks is not possible with a serial DataCommunicator." << std::endl; \
rRecvValues = rSendValues; \
} \
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
Wrappers for MPI_Scatter and MPI_Scatterv calls.