HOME
| OPENMP API Specification: "Version 5.2 -- GIT rev 95b2e3a44"

5.9  Data-Motion Clauses

Data-motion clauses specify data movement between a device set that is specified by the construct on which they appear. One member of that device set is always the encountering device, which is the device on which the encountering task for that construct executes. How the other devices, which are the targeted devices, are determined is defined by the construct specification. Each data-motion clause specifies the direction of the data movement relative to the targeted devices.

A data-motion clause specifies an OpenMP locator list as its argument. A corresponding list item and an original list item exist for each list item. If the corresponding list item is not present in the device data environment then no assignment occurs between the corresponding and original list items. Otherwise, each corresponding list item in the device data environment has an original list item in the data environment of the encountering task. Assignment is performed to either the original or corresponding list item as specified with the specific data-motion clauses. List items may reference any iterator-identifier defined in its iterator modifier. The list items may include array sections with stride expressions.

The list items may use shape-operators.

If a list item is an array or array section then it is treated as if it is replaced by each of its array elements in the clause.

If the mapper modifier is not specified, the behavior is as if the modifier was specified with the default mapper-identifier. The effect of a data-motion clause on a list item is modified by a visible user-defined mapper if mapper-identifier is specified for a type that matches the type of the list item. Otherwise, the predefined default mapper for the type of the list item applies. Each list item is replaced with the list items that the given mapper specifies are to be mapped with a map type that is compatible with the data movement direction associated with the clause.

If a present expectation is specified and the corresponding list item is not present in the device data environment then runtime error termination is performed. For a list item that is replaced with a set of list items as a result of a user-defined mapper, the expectation only applies to those mapper list items that share storage with the original list item.

If a list item or a subobject of a list item has the ALLOCATABLE attribute, its assignment is performed only if its allocation status is allocated and only with respect to the allocated storage. If a list item has the POINTER attribute and its association status is associated, the effect is as if the assignment is performed with respect to the pointer target.

On exit from the associated region, if the corresponding list item is an attached pointer, the original list item, if associated, will be associated with the same pointer target with which it was associated on entry to the region and the corresponding list item, if associated, will be associated with the same pointer target with which it was associated on entry to the region.

On exit from the associated region, if the corresponding list item is an attached pointer, the original list item will have the value it had on entry to the region and the corresponding list item will have the value it had on entry to the region.

For each list item that is not an attached pointer, the value of the assigned list item is assigned the value of the other list item. To avoid data races, concurrent reads or updates of the assigned list item must be synchronized with the update of an assigned list item that occurs as a result of a data-motion clause.

Restrictions

Restrictions to data-motion clauses are as follows:

Cross References