fixed: remove forwarding in variadic functions

these are l-values so the forward call is a noop. if they
would be pr or x-values, forwarding multiple times is not
correct.
This commit is contained in:
Arne Morten Kvarving 2022-09-13 10:06:49 +02:00
parent de0018350a
commit 4a81e5c92d

View File

@ -347,13 +347,13 @@ void broadcast(Parallel::Communication comm, int root, Args&&... args)
size_t size = 0;
if (comm.rank() == root)
variadic_packsize(size, comm, std::forward<Args>(args)...);
variadic_packsize(size, comm, args...);
comm.broadcast(&size, 1, root);
std::vector<char> buffer(size);
if (comm.rank() == root) {
int pos = 0;
variadic_pack(pos, buffer, comm, std::forward<Args>(args)...);
variadic_pack(pos, buffer, comm, args...);
}
comm.broadcast(buffer.data(), size, root);
if (comm.rank() != root) {