Commit 22843821 authored by Lukas Werner's avatar Lukas Werner
Browse files

Gather intersections only on root

parent d96abb3d
Pipeline #7011 failed with stage
in 79 minutes and 2 seconds
......@@ -338,27 +338,29 @@ void Raytracer::rayTrace(const size_t timestep) {
for (auto& info: intersections) {
sendBuffer << info.imageX << info.imageY << info.bodySystemID << info.t;
}
int gatheredIntersectionCount = 0;
std::vector<real_t> fullImage(pixelsHorizontal_ * pixelsVertical_, inf);
mpi::RecvBuffer recvBuffer;
mpi::allGathervBuffer(sendBuffer, recvBuffer);
BodyIntersectionInfo info;
while (!recvBuffer.isEmpty()) {
recvBuffer >> info.imageX;
recvBuffer >> info.imageY;
recvBuffer >> info.bodySystemID;
recvBuffer >> info.t;
size_t i = coordinateToArrayIndex(info.imageX, info.imageY);
real_t currentFullImageT = fullImage[i];
if (currentFullImageT > info.t) {
fullImage[i] = info.t;
mpi::gathervBuffer(sendBuffer, recvBuffer, 0);
//mpi::allGathervBuffer(sendBuffer, recvBuffer);
WALBERLA_ROOT_SECTION() {
BodyIntersectionInfo info;
while (!recvBuffer.isEmpty()) {
recvBuffer >> info.imageX;
recvBuffer >> info.imageY;
recvBuffer >> info.bodySystemID;
recvBuffer >> info.t;
size_t i = coordinateToArrayIndex(info.imageX, info.imageY);
real_t currentFullImageT = fullImage[i];
if (currentFullImageT > info.t) {
fullImage[i] = info.t;
}
gatheredIntersectionCount++;
}
gatheredIntersectionCount++;
}
tp_["Reduction"].end();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment