Closed mpiforumbot closed 8 years ago
Originally by RolfRabenseifner on 2010-09-01 11:38:04 -0500
-Major decisions in this ticket:*
-Details:*
Fortran 2008 will provide assumed type and assumed rank arguments, i.e.,
TYPE(*), DIMENSION(..)
.
Details are explained in http://www.j3-fortran.org/doc/year/08/08-271.txt
With
INTERFACE
SUBROUTINE MPI_Xxx(buf, ....) &
& BIND(C,NAME='mpi_xxx_f_to_c')
USE, INTRINSIC :: ISO_C_BINDING
TYPE(*), DIMENSION(..) :: buf
END SUBROUTINE MPI_Xxx
END INTERFACE
a C written wrapper mpi_xxx_f_to_c is called and buf as handed over as a pointer to a -Fortran descriptor* that can be converted to a C descriptor through the function CFI_update_cdesc() in ISO_Fortran_binding.h. Details are explained in http://www.j3-fortran.org/doc/year/08/08-305.txt
None.
The Fortran standardization body strongly works on this topic to provide a solution that explicit interfaces can be provided for all MPI routines including all choice arguments. A positive side effect is that the problems with strided arrays and nonblocking routines can also vanish. For this an implementation effort is necessary.
Chapter 2, Terms and Conventions, Section 2.5.5 Choice, page 15, lines 38-42 read
MPI functions sometimes use arguments with a choice (or union) data type. Distinct calls
to the same routine may pass by reference actual arguments of different types. The mechanism
for providing such arguments will differ from language to language.
For Fortran, the
document uses
but should read
MPI functions sometimes use arguments with a choice (or union) data type. Distinct calls
to the same routine may pass by reference actual arguments of different types. The mechanism
for providing such arguments will differ from language to language.
For Fortran with include file mpif.h
or module mpi
, the
document uses mpi_f08
, such arguments are declared with the
Fortran 2008 method `TYPE(), DIMENSION(..)`;*
for C and C++, we use void .
Advice to implementors.
The implementor can freely choose how to implement choice arguments in the module mpi
,
e.g., with a non-standard method with the quality of the call mechanism in the implicit Fortran
interfaces, or with the method defined for module mpi_f08
.
(End of advice to implementors.)
Chapter 2, Terms and Conventions, Section 2.6 Language Binding, page 16, lines 21-22 read
MPI bindings are for Fortran 90, though they are designed to be usable in Fortran 77 environments.
but should read
MPI bindings are for Fortran 90, though they are originally designed
to be usable in Fortran 77 environments.
With the module mpi_f08
, the two Fortran 2008 features assumed type and assumed rank
are also required, see Section 2.5.5. on page 15.
(Comment: Section 2.5.5. contains the new choice method TYPE(*), DIMENSION(..)
, see above.)
Chapter 2, Terms and Conventions, Section 2.6.2 Fortran Binding Issues, page 17, lines 37-40 read
Originally, MPI-1.1 provided bindings for Fortran 77. These bindings are retained, but they are now interpreted in the context of the Fortran 90 standard. MPI can still be used with most Fortran 77 compilers, as noted below. When the term Fortran is used it means Fortran 90.
but should read
Originally, MPI-1.1 provided bindings for Fortran 77. These bindings are retained, but they
are now interpreted in the context of the Fortran 90 standard. MPI can still be used with
most Fortran 77 compilers, as noted below. When the term Fortran is used it means
Fortran 90__, and Fortran 2008 if the module mpi_f08
is used__.
Text related to this ticket but shown in Ticket #230-B:
-In Section 16.2.1 Overview:*
The LOGICAL compile-time constant MPI_CHOICE_IS_F08 is true if all choice arguments are defined in explicit interfaces with standardized assume type and assumed rank, otherwise false. This constant exists with each Fortran support method, but not in the C/C++ header files. The value may be different for each Fortran support method. (#234-F)****
-_In new Section 16.2.5 Fortran Support through Module mpif08:*
__The buffers are declared with the new Fortran 2008 feature
assumed type and assumed rank "TYPE(*), DIMENSION(..)
",
and with this, non-contiguous sub-arrays are now valid also
in nonblocking routines, and MPI_CHOICE_IS_F08 is true (#234-F).
...
If the target compiler does not support explicit interfaces with
assumed type and assumed rank (as defined in Fortran 2008), then the use of non-contiguous sub-arrays
in nonblocking calls may be restricted as with module mpi
,
and MPI_CHOICE_IS_F08 is false (#234-F).
-Advice to implementors.* In this case, with most compilers the choice argument can be implemented with the following explicit interface:
` !DEC$ ATTRIBUTES NO_ARG_CHECK :: BUF `[[BR]]
` !$PRAGMA IGNORE_TKR BUF `[[BR]]
` REAL, DIMENSION(*) :: BUF `
-(End of advice to implementors.) (#234-F) *__
Text related to this ticket but shown in Ticket #232-D:
-In Section 16.2.4 Fortran Support through Module mpi*:
In this case, MPI_CHOICE_IS_F08 is false (#234-F).
'''See also Tickets #247-S and #249-U.
This ticket has major impact on existing MPI implementations, because the handling of choice buffer arguments must be reimplemented. It is definitely different to the existing C (void *) interface. The buffer description is now a combination of the Fortran sub-array argument handling (i.e., non-contiguous sub-arrays) through an array descriptor and the MPI derived datatype handles. The MPI derived datatype handles apply to a virtual contiguous memory area that is built out of the portions defined in the Fortran array descriptor.
Removal of all restrictions with the usage of Fortran array subscripts together with MPI nonblocking routines.
None.
Section xxxx on page xxx.[[BR]] yyy.
Originally by RolfRabenseifner on 2010-09-01 11:41:39 -0500
The previous comment was not intented. It is identical to the current ticket content.
Originally by RolfRabenseifner on 2012-06-12 04:46:19 -0500
Ticket is only a helper-ticket for passed #229, therefore this ticket is now marked as resolved. For further information, see status of ticket #229.
Originally by RolfRabenseifner on 2010-09-01 10:45:31 -0500
234-F: Choice buffers through "TYPE(_), DIMENSION(..)" declarationsSee Ticket #229-A for an _overview* on the New MPI-3 Fortran Support.
Votes
Straw vote Oct. 11, 2010: 13 yes, 0 no, 2 abstain.[[BR]] Voting was under the assumption that "TYPE(*), DIMENSION(..)" will have Fortran standard quality.
Description
-Major decisions in this ticket:*
-Details:*
Fortran 2008 will provide assumed type and assumed rank declarations for arguments, i.e.,
TYPE(*), DIMENSION(..)
.Details are explained in http://www.j3-fortran.org/doc/year/08/08-271.txt
With
a wrapper mpi_xxx_f_to_c (implemented in C or Fortran) is called and buf is passed as a pointer to a -Fortran descriptor* as described in http://www.j3-fortran.org/doc/year/08/08-305.txt or later.
Extended Scope
None.
History
The Fortran standardization body strongly works on this topic to provide a solution that explicit interfaces can be provided for all MPI routines including all choice arguments. A positive side effect is that the problems with strided arrays and nonblocking routines can also vanish. For this an implementation effort is necessary.
Proposed Solution
-MPI-2.2, Chapter 2, Terms and Conventions, Section 2.5.5 Choice, page 15, lines 38-42 read*
MPI functions sometimes use arguments with a choice (or union) data type. Distinct calls to the same routine may pass by reference actual arguments of different types. The mechanism for providing such arguments will differ from language to language. For Fortran, the document uses to represent a choice variable;
for C and C++, we use void *.
-but should read*
MPI functions sometimes use arguments with a choice (or union) data type. Distinct calls to the same routine may pass by reference actual arguments of different types. The mechanism for providing such arguments will differ from language to language. For Fortran with the include file to represent a choice variable;
*with the Fortran
mpif.h
or thempi
module, the document usesmpi_f08
module, such arguments are declared with the Fortran 2008 syntax `TYPE(), DIMENSION(..)`;* for C and C++, we use void .**Advice to implementors. The implementor can freely choose how to implement choice arguments in the
mpi
module, e.g., with a non-standard compiler-dependent method that has the quality of the call mechanism in the implicit Fortran interfaces, or with the method defined for thempi_f08
module. -(End of advice to implementors.)***-MPI-2.2, Chapter 2, Terms and Conventions, Section 2.6 Language Binding, page 16, lines 21-22 read*
MPI bindings are for Fortran 90, though they are designed to be usable in Fortran 77 environments.
-but should read*
MPI bindings are for Fortran 90 and later, though they
arewere originally designed to be usable in Fortran 77 environments. With thempi_f08
module, the two Fortran 2008 features assumed type and assumed rank are also required, see Section 2.5.5. on page 15.(Comment: MPI-2.2, Section 2.5.5. contains the new choice method
TYPE(*), DIMENSION(..)
, see above.)-MPI-2.2, Chapter 2, Terms and Conventions, Section 2.6.2 Fortran Binding Issues, page 17, lines 37-40 read*
Originally, MPI-1.1 provided bindings for Fortran 77. These bindings are retained, but they are now interpreted in the context of the Fortran 90 standard. MPI can still be used with most Fortran 77 compilers, as noted below. When the term Fortran is used it means Fortran 90.
-but should read*
Originally, MPI-1.1 provided bindings for Fortran 77. These bindings are retained, but they are now interpreted in the context of the Fortran 90 standard. MPI can still be used with most Fortran 77 compilers, as noted below. When the term Fortran is used it generally means Fortran 90__ and later; it means Fortran 2008 and later if the
mpi_f08
module is used__.Text related to this ticket but shown in Ticket #230-B:
-In Section 16.2.1 Overview:*
The INTEGER compile-time constant MPI_SUBARRAYS equals MPI_SUBARRAYS_SUPPORTED if all choice arguments are defined in explicit interfaces with standardized assumed type and assumed rank, otherwise it equals MPI_SUBARRAYS_UNSUPPORTED. This constant exists with each Fortran support method, but not in the C/C++ header files. The value may be different for each Fortran support method. (#234-F)****
-_In new Section 16.2.5 Fortran Support Through the mpif08 Module:*
Set the MPI_SUBARRAYS compile-time constant to MPI_SUBARRAYS_UNSUPPORTED and declare choice buffers with a compiler-dependent mechanism that overrides type checking if the underlying Fortran compiler does not support the Fortran 2008 assumed-type and assumed-rank notation. In this case, the use of non-contiguous sub-arrays in nonblocking calls may be restricted as with the
mpi
module. (#234-F)Advice to implementors. In this case, the choice argument may be implemented with an explicit interface with compiler directives, for example:
!DEC$ ATTRIBUTES NO_ARG_CHECK :: BUF
[[BR]]!$PRAGMA IGNORE_TKR BUF
[[BR]]REAL, DIMENSION(*) :: BUF
(End of advice to implementors.) (#234-F)****
Text related to this ticket but shown in Ticket #232-D:
-In Section 16.2.4 Fortran Support through the mpi Module:*
In this case, the compile-time constant MPI_SUBARRAYS equals MPI_SUBARRAYS_UNSUPPORTED \ (#234-F).**
'''See also Tickets #247-S and #249-U.
Impact on Implementations
This ticket has major impact on existing MPI implementations, because the handling of choice buffer arguments must be reimplemented. It is definitely different from the existing C (void *) interface. The buffer description is now a combination of the Fortran sub-array argument handling (i.e., non-contiguous sub-arrays) through an array descriptor and the MPI derived datatype handles. The MPI derived datatype handles apply to a virtual contiguous memory area that is built out of the portions defined in the Fortran array descriptor.
Impact on Applications / Users
Removal of all restrictions with the usage of Fortran array triplet-subscripts (e.g.,
a(1:100:3)
) together with MPI nonblocking routines, but not with vector-subsripts (e.g.,a([1,7,8,17,97])
).Alternative Solutions
None.
Entry for the Change Log
MPI-2.2, Section xxxx on page xxx.[[BR]] yyy.