[flang-commits] [flang] [flang][RFC] Adding a design document for assumed-rank objects (PR #71959)

via flang-commits flang-commits at lists.llvm.org
Wed Nov 15 03:28:55 PST 2023


jeanPerier wrote:

> Does this have an effect on the processing of the ignore_tkr directive?

Good question. No more than when passing to an assumed-shape.
- It is forbidden (and pointless) to use IGNORE_TKR(r) on an assumed rank dummy
- It is possible to use IGNORE_TKR(tk)  on an assumed rank dummy (but highly preferable to use TYPE(*)). In which case on caller side, the dynamic type information in the descriptor will be set according to the actual. But just like with assumed shapes, if the procedure with ignore_tkr is implemented in Fortran, it is quite unspecified what type it will be considered to have inside the procedure. Any direct usages of the incoming descriptor in the Fortran runtime will behave according to the actual argument type, while any new inline and new descriptor created will use the dummy type information.
- It is possible to pass an assumed-rank object to an explicit shape/assumed-size array dummy that has IGNORE_TKR(R). In which case, lowering will do copy_in/copy_out as when passing to a contiguous assumed-rank, and then pass only the base address instead of the descriptor.

>  I think the new mpi module (mpi_f08) uses assumed rank arrays.

Indeed, there is mention of assumed rank in the MPI standard https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf
I added a note in annex about using mpi_f08 to test for this feature, thanks for pointing to it.

> Please add the document to the index file (https://github.com/llvm/llvm-project/blob/main/flang/docs/index.md).

Done, thanks.

https://github.com/llvm/llvm-project/pull/71959


More information about the flang-commits mailing list