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__
39#define RESTRICT __restrict
48 :
public ::walberla::communication::UniformPackInfo {
56 void unpackData(IBlock *receiver, stencil::Direction dir,
57 mpi::RecvBuffer &buffer)
override {
58 const auto dataSize =
size(dir, receiver);
59 auto bufferSize = dataSize +
sizeof(float);
60 auto bufferPtr =
reinterpret_cast<void *
>(buffer.skip(bufferSize));
61 std::align(
alignof(
float), dataSize, bufferPtr, bufferSize);
62 unpack(dir,
reinterpret_cast<unsigned char *
>(bufferPtr), receiver);
66 stencil::Direction dir)
override {
67 mpi::SendBuffer sBuffer;
68 packData(sender, dir, sBuffer);
69 mpi::RecvBuffer rBuffer(sBuffer);
70 unpackData(receiver, stencil::inverseDir[dir], rBuffer);
74 mpi::SendBuffer &outBuffer)
const override {
75 const auto dataSize =
size(dir, sender);
76 auto bufferSize = dataSize +
sizeof(float);
77 auto bufferPtr =
reinterpret_cast<void *
>(outBuffer.forward(bufferSize));
78 std::align(
alignof(
float), dataSize, bufferPtr, bufferSize);
79 pack(dir,
reinterpret_cast<unsigned char *
>(bufferPtr),
80 const_cast<IBlock *
>(sender));
83 void pack(stencil::Direction dir,
unsigned char *buffer, IBlock *
block)
const;
84 void unpack(stencil::Direction dir,
unsigned char *buffer,
86 uint_t
size(stencil::Direction dir,
const IBlock *
block)
const;
void packDataImpl(const IBlock *sender, stencil::Direction dir, mpi::SendBuffer &outBuffer) const override
void pack(stencil::Direction dir, unsigned char *buffer, IBlock *block) const
uint_t size(stencil::Direction dir, const IBlock *block) const
void unpackData(IBlock *receiver, stencil::Direction dir, mpi::RecvBuffer &buffer) override
PackInfoPdfSinglePrecision(BlockDataID pdfsID_)
bool threadsafeReceiving() const override
void unpack(stencil::Direction dir, unsigned char *buffer, IBlock *block) const
void communicateLocal(const IBlock *sender, IBlock *receiver, stencil::Direction dir) override
bool constantDataExchange() const override
~PackInfoPdfSinglePrecision() override=default
static double * block(double *p, std::size_t index, std::size_t size)
\file PackInfoPdfDoublePrecision.cpp \author pystencils