mpi-forum / mpi-forum-historic

Migration of old MPI Forum Trac Tickets to GitHub. New issues belong on mpi-forum/mpi-issues.
http://www.mpi-forum.org
2 stars 3 forks source link

Chap.2 errata: Missing "in C" in wording about handle-comparison #449

Open mpiforumbot opened 8 years ago

mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2014-08-13 10:52:04 -0500


Description

This change is for consistency reasons. Level is ticket-0.

This requirement "The C types must support the use of the assignment and equality operators" is done only in C (see page 13 line 4).

The text on page 14 lines 6-11 comments this requirement, therefore it is also only valid in C. The proposed solution adds this "in C".

The old Fortran mpi interface does not requires this because INTGER are always usable in assignment and equality operators. The new Fortran mpi_f08 interface requires such operator overloading for the comparison of handles, see page 12 lines 44-46.

The existing text on page 14 lines 6-11 is definitely wrong for Fortran and was never intended for Fortran. Therefore the proposed solution is needed.

History

This small inconsistency was overseen when finishing MPI-3.0. This ticket #422 was split into its parts. This ticket is one part D of #422.

Extended Scope

None. (No need to add these changes to the erratas.)

Proposed Solution

-MPI-3.0 page 14 lines 6-11 read*

The requirement that handles support assignment/comparison is made since such operations are common. This restricts the domain of possible implementations. The alternative would have been to allow handles to have been an arbitrary, opaque type. This would force the introduction of routines to do assignment and comparison, adding complexity, and was therefore ruled out. (End of rationale.)

-but should read*

The requirement that handles support assignment/comparison is made since such operations are common. This restricts the domain of possible implementations. The alternative in C would have been to allow handles to have been an arbitrary, opaque type. This would force the introduction of routines to do assignment and comparison, adding complexity, and was therefore ruled out. In Fortran, the handles are defined such that assignment and comparison are available through the operators of the language or overloaded versions of these operators. -(End of rationale.)*

Impact on Implementations

None required.

Impact on Applications / Users

None.

Entry for the Change Log

None.

Voting category

Single-vote in category MPI-3.0-errata.

It would be possible to decide it by the chapter committee (because of ticket-0 quality), but this committee is currently very small, and therefore errata-vote is better.

Although it is MPI-3.0 errata, i.e. corrections of inconsistencies in the MPI-3.0 document, it is not necessary to publish this item in the MPI-3.0 errata document due to the minor priority of this item. It is enough to have them in the MPI-3.1 document.

mpiforumbot commented 8 years ago

Originally by gropp on 2014-08-14 09:35:09 -0500


Are you saying that the new Fortran interface does not require that handles support assignment and comparison? Or that supporting assignment and comparison of handles doesn't add any restrictions to the implementation in Fortran? I do not see what this change accomplishes, and I do not see an error.

mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2014-08-14 10:04:08 -0500


Replying to gropp:

In Fortran, there is no implementation freedom for handles, see page 12 line 40 - page 13 line 3.

In C there is some freedom. This freedom was restricted by page 13 line 4:

-"The C types must support the use of the assignment and equality operators."*

This sentence defines a requirement, but only for C.

MPI-3.0 page 14 lines 6-11 is a comment about this requirement in C, and not about the INTEGER based implementation solution in Fortran.

In Fortran, the sentences

"The alternative would have been to allow handles to have been an arbitrary, opaque type. This would force the introduction of routines to do assignment and comparison, adding complexity, and was therefore ruled out."

are not correct for Fortran, because user-callable routines are not required because operator overloading would be the method and is used in mpi_f08, i.e. not ruled out.

This all were my reasons for adding "In C". Is it correct?

mpiforumbot commented 8 years ago

Originally by gropp on 2014-08-14 14:58:03 -0500


Most of this section should be read as applying to any binding. I don't see anything wrong with the current text, which can also be read as explaining why there are no language-independent routines for assignment or comparison of handles.

mpiforumbot commented 8 years ago

Originally by jdinan on 2014-09-05 10:18:43 -0500


I don't think the passage that Rolf cited cited (pg. 13, line 4) supports this change. That passage is just providing justification for why handles are integers in Fortran and different types in C. Among handles of the same type one should be able to perform assignment and comparison operations in Fortran as well. Unless my understanding is wrong, this looks like it will break backward compatibility and make the rationale inconsistent with the normative text.

mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2014-09-06 09:30:23 -0500


For C, it is clear we have the requirement "The C types must support the use of the assignment and equality operators" (see page 13 line 4) and we have some implementation freedom about the internal type of handles.

In Fortran, we have no implementation freedom. In the mpi module and mpif.h, handles must be INTEGER and we do not have further requirements because assignment and equality operators are usable for INTEGER.

In the Fortran mpi_f08 module, handles are well defined structures (no freedom on page 13, lines 1-3!) and page 12 lines 44-45 require "The operators .EQ., .NE., == and /= are overloaded to allow the comparison of these handles."

Therefore, in C, we can say "In C, the requirement that handles support assignment/comparison is made since such operations are common" (page 13, line 6).

In Fortran, the sentence should be something like "In Fortran, the definition of the handles and their operators guarantees that the handles support the common operations assignment and comparison."

For C, the second part is also valid:

"The alternative would have been to allow handles to have been an arbitrary, opaque type. This would force the introduction of routines to do assignment and comparison, adding complexity, and was therefore ruled out."

In Fortran, an opaque type would not require routines. It only requires operator overloading. In mpi_f08, we use such types and we do such operator overloading. We decided a fixed structure and not to use "opaque" types for another reason: The conversion between mpif.h INTEGER handles and mpi_f08 handles can be done by normal Fortran statements, i.e., without defining conversion routines. The cited sentence in the MPI standard is therefore completely wrong for Fortran.

In short words, this section is definitely wrong for Fortran. The only correct statement that may be helpful for Fortran:

In Fortran, the handles are defined such that assignment and comparison are available through the operators of the language or overloaded versions of these operators.

I added this as alternative solution.

Before voting that ticket, one should vote which version should be voted for. For the alternative version, one should also decide that the additional sentence is an allowed amendment within the 14 days before the voting.

mpiforumbot commented 8 years ago

Originally by jdinan on 2014-09-08 11:08:10 -0500


Rolf, thank you for the explanation. The alternative text looks good to me. It addresses my concern that the other solution incorrectly implies Fortran does not support assignment/comparison.

mpiforumbot commented 8 years ago

Originally by jdinan on 2014-09-15 00:02:13 -0500


We looked at the ticket during today's meeting and the Forum prefers the alternative solution. If you agree, can you remove the original solution so that the ticket is set up for voting?

mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2014-09-16 11:30:24 -0500


I removed the original solution and set up the alternative solution for voting, which is now renamed into "Proposed solution".

mpiforumbot commented 8 years ago

Originally by jsquyres on 2014-12-10 13:04:45 -0600


Forum feedback -- change from:

__In C,__ the requirement ...

to

The requirement that handles support assignment/comparison is made since such operations are common. This restricts the domain of possible implementations. The alternative __in C__ would have been ...
mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2015-02-04 08:23:38 -0600


Attachment added: ticket449_diff_r1919.txt (0.7 KiB) For pdf review

mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2015-02-04 08:24:33 -0600


Attachment added: ticket449_terms-2.pdf (137.8 KiB) For pdf review

mpiforumbot commented 8 years ago

Originally by RolfRabenseifner on 2015-02-04 08:25:50 -0600


svn revision 1919, see attached files