mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-20 11:48:25 -06:00
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:
parent
de0018350a
commit
4a81e5c92d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user