25#include "communication/UniformPackInfo.h"
26#include "core/DataTypes.h"
27#include "core/cell/CellInterval.h"
28#include "domain_decomposition/IBlock.h"
29#include "field/GhostLayerField.h"
30#include "stencil/Directions.h"
37#define RESTRICT __restrict__
46 :
public ::walberla::communication::UniformPackInfo {
54 void unpackData(IBlock *receiver, stencil::Direction dir,
55 mpi::RecvBuffer &buffer)
override {
56 const auto dataSize =
size(dir, receiver);
57 auto bufferSize = dataSize +
sizeof(double);
58 auto bufferPtr =
reinterpret_cast<void *
>(buffer.skip(bufferSize));
59 std::align(
alignof(
double), dataSize, bufferPtr, bufferSize);
60 unpack(dir,
reinterpret_cast<unsigned char *
>(bufferPtr), receiver);
64 stencil::Direction dir)
override {
65 mpi::SendBuffer sBuffer;
66 packData(sender, dir, sBuffer);
67 mpi::RecvBuffer rBuffer(sBuffer);
68 unpackData(receiver, stencil::inverseDir[dir], rBuffer);
72 mpi::SendBuffer &outBuffer)
const override {
73 const auto dataSize =
size(dir, sender);
74 auto bufferSize = dataSize +
sizeof(double);
75 auto bufferPtr =
reinterpret_cast<void *
>(outBuffer.forward(bufferSize));
76 std::align(
alignof(
double), dataSize, bufferPtr, bufferSize);
77 pack(dir,
reinterpret_cast<unsigned char *
>(bufferPtr),
78 const_cast<IBlock *
>(sender));
81 void pack(stencil::Direction dir,
unsigned char *buffer, IBlock *
block)
const;
82 void unpack(stencil::Direction dir,
unsigned char *buffer,
84 uint_t
size(stencil::Direction dir,
const IBlock *
block)
const;
void packDataImpl(const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &outBuffer) const override
void unpack(stencil::Direction dir, unsigned char *buffer, IBlock *block) const
bool threadsafeReceiving() const override
~PackInfoPdfDoublePrecision() override=default
void unpackData(IBlock *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer) override
void communicateLocal(const IBlock *sender, IBlock *receiver, stencil::Direction dir) override
PackInfoPdfDoublePrecision(BlockDataID pdfsID_)
void pack(stencil::Direction dir, unsigned char *buffer, IBlock *block) const
uint_t size(stencil::Direction dir, const IBlock *block) const
bool constantDataExchange() const override
static double * block(double *p, std::size_t index, std::size_t size)
\file PackInfoPdfDoublePrecision.cpp \author pystencils