Jonas,
The section 5.1.6 in MPI 4.0 should give you a better idea about the
differences between size, extent and true extent. There are also few
examples in Section 5.1.14 on how to manipulate the datatype using extent.
I think you should find Examples 5.13 to 5.16 of particular interest.
Best,
Hi George,
thanks, I'm starting to understand this now.
Still not quite intuitive that "Type_create_resized" allows me to reset
the extent but not the size (just from a naming perspective).
The man page is talking about extent, upper and lower bounds, but the
upper bound cannot be
You are confusing the size and extent of the datatype. The size (aka the
physical number of bytes described by the memory layout) would be
m*nloc*sizeof(type), while the extent will be related to where you expect
the second element of the same type to start. If you do resize, you will
incorporate
Dear Gilles,
thanks, the resizing fixes the issue, it seems. It is not really
intuitive, though, because the actual extent of the data type is
m*nloc*sizeof(int) and I have to make MPI believe that it is
nloc*sizeof(int). And indeed, this seems to be not OpenMPI-specific,
sorry for that.
Jonas,
In case I misunderstood your question and you want to print
v_glob on P0: 9x2
0 9
1 10
2 11
3 12
4 13
5 14
6 15
7 16
8 17
then you have to fix the print invocation
// note: print an additional column to show the displacement error we get:
if (!rank) print("v_glob", rank, n, m,
Jonas,
Assuming v_glob is what you expect, you will need to
`MPI_Type_create_resized_type()` the received type so the block received
from process 1 will be placed at the right position (v_glob[3][1] => upper
bound = ((4*3+1) * sizeof(int))
Cheers,
Gilles
On Thu, Dec 16, 2021 at 6:33 PM Jonas