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) { ...@@ -338,27 +338,29 @@ void Raytracer::rayTrace(const size_t timestep) {
for (auto& info: intersections) { for (auto& info: intersections) {
sendBuffer << info.imageX << info.imageY << info.bodySystemID << info.t; sendBuffer << info.imageX << info.imageY << info.bodySystemID << info.t;
} }
int gatheredIntersectionCount = 0; int gatheredIntersectionCount = 0;
std::vector<real_t> fullImage(pixelsHorizontal_ * pixelsVertical_, inf); std::vector<real_t> fullImage(pixelsHorizontal_ * pixelsVertical_, inf);
mpi::RecvBuffer recvBuffer; mpi::RecvBuffer recvBuffer;
mpi::allGathervBuffer(sendBuffer, recvBuffer);
BodyIntersectionInfo info; mpi::gathervBuffer(sendBuffer, recvBuffer, 0);
while (!recvBuffer.isEmpty()) { //mpi::allGathervBuffer(sendBuffer, recvBuffer);
recvBuffer >> info.imageX;
recvBuffer >> info.imageY; WALBERLA_ROOT_SECTION() {
recvBuffer >> info.bodySystemID; BodyIntersectionInfo info;
recvBuffer >> info.t; while (!recvBuffer.isEmpty()) {
recvBuffer >> info.imageX;
size_t i = coordinateToArrayIndex(info.imageX, info.imageY); recvBuffer >> info.imageY;
real_t currentFullImageT = fullImage[i]; recvBuffer >> info.bodySystemID;
if (currentFullImageT > info.t) { recvBuffer >> info.t;
fullImage[i] = 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(); 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