defer_sync
- Date:
01-09-2012
NAME
defer_sync - defer the synchronization of PGAS data
SYNOPSIS
#pragma pgas defer_sync
!DIR$ PGAS DEFER_SYNC
IMPLEMENTATION
Cray Linux Environment (CLE) on Cray XE systems
DESCRIPTION
PGAS data references made by the single statement immediately following the pgas defer_sync directive will not be synchronized until the next fence instruction.
Normally the compiler synchronizes the references in a statement as late as possible without violating program semantics. The purpose of the defer_sync directive is to synchronize the references even later, beyond where the compiler can determine it is safe.
For example, if there is a remote-memory access (RMA) put near the end of a subroutine, the compiler must guard against the put value being read back immediately after the subroutine returns, so the put is synchronized just before returning. The programmer, however, may know that the value is not read back and can insert a pgas defer_sync directive.
EXAMPLES
Example 1: Coarray Fortran
subroutine my_put( x, image, value )
integer :: x[*], image, value
!dir$ pgas defer_sync
x[image] = value
end subroutine
Example 2: UPC
void my_put( shared int* x, int thread, int value ) {
#pragma pgas defer_sync
x[thread] = value;
}
SEE ALSO
intro_directives(7)