To: J3 10-233 From: R. Bader, R. Rabenseifner Subject: assumed size actuals and assumed rank dummies Date: 2010 October 08 References: 10-165r2, N1814 The concept of assumed rank dummy arguments was introduced in the TR to relieve developers of interfaces with choice buffers from needing to write huge numbers of specific interface calls. Specifically, the MPI-3 effort to update the Fortran MPI bindings intends to deploy the features provided by the TR such that - for the most part - only a single set of wrapper functions will be required and full (?) backward compatibility on the source level is guaranteed i.e., compatibility with implicit interfaces. However, with the presently available functionality, no mention is made on how an assumed size actual argument matching an assumed rank dummy argument is treated. For the case of assumed shape dummy arguments, section 12.5.2.4 para 14 of N1814 prohibits an assumed size actual argument (since the shape information is not fully available), but making this rule also apply to the assumed-rank case would make implementation of a backward compatible MPI-3 interface impossible. Therefore, based on a suggestion by Bill Long, this paper adopts a convention for producing a partially valid descriptor. SUGGESTED EDITS to 10-165r2: [5:9-10]: After "is an array", add " which is not of assumed size". After the end of the sentence, add "If the actual argument is an array which is of assumed size, the bounds of all but the last dimension are assumed from the actual argument; the lower and upper bounds of the last dimension have the value one, and the first element of the actual argument is sequence associated with the first element of the dummy argument." Furthermore, add "NOTE 3.1- Based on separately available information on the actual argument's size, an implementation of the called subprogram written in C can define or reference data corresponding to values of the last dimension which are larger than one, or if the size turns out to be smaller than the product of the extents of all but the last dimension, avoid performing invalid accesses." COMMENT: For the reason hinted at in the last part of the above NOTE, it is considered desirable to limit this functionality to BIND(C) interfaces; for the latter, the loss of safety could be considered negligible since the use of pointers unpacked from a CFI_cdesc_t is unsafe anyway. The reason J3 might wish to limit the feature to BIND(C) is that in a future version of the standard which supports explicit referencing or definition of an assumed-rank entity the integrity of the object the descriptor points to must be assured. The MPI Forum concurs with this, since its desire is to implement the MPI-3 interface using a thin BIND(C) mapping, but points out that to achieve its goal additional support for passing CHARACTER*(*) entities through a BIND(C) interface is required. The (reiterated) feature request for this is described in a separate paper.