20.1.8. Additional Support for Fortran Register-Memory-Synchronization

PreviousUpNext
Up: Support for Fortran Next: Additional Support for Fortran Numeric Intrinsic Types Previous: Requirements on Fortran Compilers

As described in Section Problems with Code Movement and Register Optimization, a dummy call may be necessary to tell the compiler that registers are to be flushed for a given buffer or that accesses to a buffer may not be moved across a given point in the execution sequence. Only a Fortran binding exists for this call.

MPI_F_SYNC_REG(buf)
INOUT bufinitial address of buffer (choice)
Fortran 2008 binding
MPI_F_sync_reg(buf)

TYPE(*), DIMENSION(..), ASYNCHRONOUS :: buf
Fortran binding
MPI_F_SYNC_REG(BUF)

<type> BUF(*)

This routine has no executable statements. It must be compiled in the MPI library in such a manner that a Fortran compiler cannot detect in the module that the routine has an empty body. It is used only to force the compiler to flush a cached register value of a variable or buffer back to memory (when necessary), or to invalidate the register value.


Rationale.

This function is not available in other languages because it would not be useful. This routine has no ierror return argument because there is no operation that can fail. ( End of rationale.)

Advice to implementors.

This routine can be bound to a C routine to minimize the risk that the Fortran compiler can learn that this routine is empty (and that the call to this routine can be removed as part of an optimization). However, it is explicitly allowed to implement this routine within the mpi_f08 module according to the definition for the mpi module or mpif.h to circumvent the overhead of building the internal dope vector to handle the assumed-type, assumed-rank argument. ( End of advice to implementors.)

Rationale.

This routine is not defined with TYPE(*), DIMENSION(*), i.e., assumed size instead of assumed rank, because this would restrict the usability to ``simply contiguous'' arrays and would require overloading with another interface for scalar arguments. ( End of rationale.)

Advice to users.

If only a part of an array (e.g., defined by a subscript triplet) is used in a nonblocking routine, it is recommended to pass the whole array to MPI_F_SYNC_REG anyway to minimize the overhead of this no-operation call. Note that this routine need not be called if MPI_ASYNC_PROTECTS_NONBLOCKING is .TRUE. and the application fully uses the facilities of ASYNCHRONOUS arrays. ( End of advice to users.)


PreviousUpNext
Up: Support for Fortran Next: Additional Support for Fortran Numeric Intrinsic Types Previous: Requirements on Fortran Compilers


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023