ompi/win: use type int* for MPI_WIN_DISP_UNIT, MPI_WIN_CREATE_FLAVOR … #1018
ompi/win: use type int* for MPI_WIN_DISP_UNIT, MPI_WIN_CREATE_FLAVOR … #1018
Conversation
…and MPI_WIN_MODEL Thanks Alastair McKinstry for the report. (cherry picked from commit open-mpi/ompi@d08fb46)
Test PASSed. |
:bot:assign: @hjelmn |
@jsquyres I have no idea what the change means. Fortran and attributes. |
@hjelmn attribute types are defined in table 11.1 (chapter 11.2.6 page 414 of MPI 3.1 standard) i can only guess there are historical reasons for using both fortran and mpi1 vs mpi2 ... |
@@ -167,18 +167,18 @@ config_window(void *base, size_t size, int disp_unit, | |||
MPI_WIN_SIZE, size, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"size" here isn't an MPI_Aint -- it's a size_t. In most situations, they'll likely be the same -- but shouldn't this be cast to be 100% safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hjelmn Actually, size_t
is unsigned here, and MPI_Aint
is a ptrdiff_t
, which is signed. Can't this cause a problem in some cases?
this is a bug reported at open-mpi/ompi#1446 |
@ggouaillardet I guess I'm confused as to how this fixed the bug. 😕 Is there some subtlety about 4-byte integer to 8-byte integer promotion that is different between little and big endian machines that would explain what is happening here? Or maybe something about a signed to unsigned promotion...? |
my latest theory is that the change is only visible when retrieving the attribute ... |
I talked a little about this with @goodell -- our theory is that it's not a problem of the promotion of the argument, but rather in a difference between how the |
👍 |
ompi/win: use type int* for MPI_WIN_DISP_UNIT, MPI_WIN_CREATE_FLAVOR …
@jsquyres What about the (maybe unlikely) case where |
@dalcinl I think we should be ok. I'm pretty sure the problem was not a promotion issue, but rather how |
@jsquyres But then, it they are stored ad an 8 bytes values ( IOW, if the hypothetical case that |
@dalcinl iirc, the Fortran binding/glue does the conversion between int and Fint. |
@ggouaillardet This is not about Fortran bindings or inter-language operability. It is about how attributes are stored/read. In MPI, attribute values can be either As I do not expect |
@dalcinl Are you sure? See https://github.com/open-mpi/ompi/blob/master/ompi/attribute/attribute.c#L27-L192. When the These functions (https://github.com/open-mpi/ompi/blob/master/ompi/attribute/attribute.c#L27-L192) read the attribute values, and then call the relevant |
Yes, it seems to me that something is wrong. I'll try to elaborate what I'm getting from the actual code: For now on, let's assume
|
I'm not sure I understand your premise:
I don't know of any platform where that is true. Specifically if Did you mean Regardless, I think I follow your example. But I think the last line is wrong, because your premise (either with So in your example, if Does that sound right? |
Sorry, yes, I meant |
No worries, I agree that it would be good to fix this case. And @ggouaillardet Do you have a Fortran compiler on a big endian machine where you can force |
@ggouaillardet I thought icc might have an option for making |
…and MPI_WIN_MODEL
Thanks Alastair McKinstry for the report.
(cherry picked from commit open-mpi/ompi@d08fb46)