Skip to content
Snippets Groups Projects
Commit cf7d38f8 authored by Simon Heybrock's avatar Simon Heybrock
Browse files

Re #21181. Minor cleanup in IndexInfo.

parent 0109f03b
No related branches found
No related tags found
No related merge requests found
......@@ -264,10 +264,10 @@ IndexInfo::globalSpectrumIndicesFromDetectorIndices(
std::vector<size_t> allSizes;
Parallel::gather(communicator(), size(), allSizes, 0);
std::vector<GlobalSpectrumIndex> spectrumIndices;
int tag = 0;
if (communicator().rank() == 0) {
for (int rank = 1; rank < communicator().size(); ++rank) {
spectrumDefinitions[rank].resize(allSizes[rank]);
int tag = 0;
auto buffer = reinterpret_cast<char *>(spectrumDefinitions[rank].data());
auto bytes = static_cast<int>(sizeof(int64_t) * allSizes[rank]);
communicator().recv(rank, tag, buffer, bytes);
......@@ -297,13 +297,11 @@ IndexInfo::globalSpectrumIndicesFromDetectorIndices(
"possible");
}
for (int rank = 1; rank < communicator().size(); ++rank) {
int tag = 0;
auto buffer = reinterpret_cast<char *>(spectrumIndices.data());
auto bytes = static_cast<int>(sizeof(int64_t) * spectrumIndices.size());
communicator().send(rank, tag, buffer, bytes);
}
} else {
int tag = 0;
auto buffer = reinterpret_cast<char *>(thisRankSpectrumDefinitions.data());
auto bytes = static_cast<int>(sizeof(int64_t) * size());
communicator().send(0, tag, buffer, bytes);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment