_gfortran_caf_send_by_ref— Sending data from a local image to a remote image with enhanced referencing options
Called to send a scalar, an array section or a whole array from a local to a remote image identified by the image_index.
void _gfortran_caf_send_by_ref (caf_token_t token, int image_index,
gfc_descriptor_t *src, caf_reference_t *refs, int dst_kind, int src_kind,
bool may_require_tmp, bool dst_reallocatable, int *stat)
|token||intent(in) An opaque pointer identifying the coarray.|
|image_index||intent(in) The ID of the remote image; must be a positive number.|
|src||intent(in) Array descriptor of the local array to be transferred to the remote image|
|refs||intent(in) The references on the remote array to store the data given by src. Guaranteed to have at least one entry.|
|dst_kind||intent(in) Kind of the destination argument|
|src_kind||intent(in) Kind of the source argument|
|may_require_tmp||intent(in) The variable is |
|dst_reallocatable||intent(in) Set when the destination is of allocatable or pointer type and the refs will allow reallocation, i.e., the ref is a full array or component ref.|
|stat||intent(out) When non-|
It is permitted to have image_index equal the current image; the memory of
the send-to and the send-from might (partially) overlap in that case. The
implementation has to take care that it handles this case, e.g. using
memmove which handles (partially) overlapping memory. If
may_require_tmp is true, the library might additionally create a
temporary variable, unless additional checks show that this is not required
(e.g. because walking backward is possible or because both arrays are
memmove takes care of overlap issues).
Note that the assignment of a scalar to an array is permitted. In addition, the library has to handle numeric-type conversion and for strings, padding and different character kinds.
Because of the more complicated references possible some operations may be unsupported by certain libraries. The library is expected to issue a precise error message why the operation is not permitted.