mpi-forum / mpi-issues

Tickets for the MPI Forum
http://www.mpi-forum.org/
67 stars 8 forks source link

Question about MPI_VAL in example #661

Closed VictorEijkhout closed 1 year ago

VictorEijkhout commented 1 year ago

Now that we're on the topic of non-normative code anyway....

Example 6.21 has the line

if (type%MPI_VAL == MPI_REAL%MPI_VAL) then

Section 2.5.1 explains this single member of the various Fortran2008 types that used to be opaque INTEGERs. It also states that (among others) the == operator is overloaded for types.

Therefore should that line in the example read

if (type == MPI_REAL) then

and we should not bother the reader with what is really an (albeit standardized) implementation detail?

jeffhammond commented 1 year ago

This example should be fixed. We should not shown users the wrong way to do things. I suspect this happened because a C programmer wrote the example 😏

jeffhammond commented 1 year ago

@RolfRabenseifner do you agree on the fix? If so, I'll create a PR next week.

RolfRabenseifner commented 1 year ago

I agree. Good catch!

jeffhammond commented 1 year ago

@VictorEijkhout I created the pull request to fix this already, although you can't see it unless you are in the MPI GH org. If you're not, we can fix that.

VictorEijkhout commented 1 year ago

MPI GH org

“GH”?

I see your pull request 785.

V.

jeffhammond commented 1 year ago

GH=GitHub