Fix mpi gather scatter
This MR fixes the wrong computation of the data length in igather
and iscatter
.
In addition, it adds a test that uses igather
and iscatter
with a datatype that has length larger than 1.
Merge request reports
Activity
added 1 commit
- ab926cb1 - fix igather and iscatter in mpicommunication
added 1 commit
- b2bafd86 - add missing includes and fix initialization of array in mpigatherscattertest
Is this bug in any stable DUNE versions and might be triggered implicitly if user code does not use iscatter or igather?
Edited by Markus BlattApparently this is in the 2.7 release.
@gruenich as you are planing a bug-fix release soon... we should definitely backport/include this fix.
Just a side note (and I might be splitting hairs, here): I think we should stop allowing different types for receive and send, or request a second size for the receive (rather than guessing). One could imagine scattering 10 MPI_INTs for each process and receiving 5 custom MPI_Type (consisting of two consectutive MPI_INTs).
You're right.
Actually, I consider that the receive buffer could be larger as needed. That is because the receive size is deduced from the input size. That does not work if the datatypes do not match.
Alternatively, we could assume that the receive buffer has the correct size and compute the receive size as
outlen = mpidata_out.size()/procs;
That would work for different MPI_Datatypes.
In the first case we could also think about resizing the receive buffer if it is to small and resizable.
So we should either check if the datatypes match or use the second approach. Opinions?
I'm going to merge this MR, as we definitely fix the bug.
@markus.blatt would you please open an issue regarding the data types?
mentioned in commit 6c31280e
picked the changes into the branch
cherry-pick-6c31280e
with commit 94d28a4dmentioned in commit 94d28a4d
mentioned in merge request !886 (merged)