_gfortran_caf_send_to_remote (The GNU Fortran Compiler)

#### 7.2.15 `_gfortran_caf_send_to_remote` — Send data to a remote image using a remote side accessor to store it ¶

Synopsis:

  `void _gfortran_caf_send_to_remote (caf_token_t token, gfc_descriptor_t *opt_dst_desc, const size_t *opt_dst_charlen, const int image_index, const size_t src_size, const void *src_data, size_t *opt_src_charlen, const gfc_descriptor_t *opt_src_desc, const int setter_index, void *add_data, const size_t add_data_size, int *stat, caf_team_t *team, int *team_number)`

Description:

  Called to send a scalar, an array section or a whole array to a remote image identified by the image_index. The call modifies the memory of the remote image.

Arguments:

  token | intent(in) An opaque pointer identifying the coarray.
  opt_dst_desc | intent(inout) A pointer to the descriptor when the object identified by token is an array with a descriptor. The parameter needs to be set to `NULL`, when token identifies a scalar or is an array without a descriptor.
  opt_dst_charlen | intent(in) When the object to send is a char array with deferred length, then this parameter needs to be set to point to its length. Else the parameter needs to be set to `NULL`.
  image_index | intent(in) The ID of the remote image; must be a positive number. `this_image ()` is valid.
  src_size | intent(in) The size of data expected to be transferred to the remote image. If the data type to get is a string or string array, then this needs to be set to the byte size of each character, i.e. `4` for a `CHARACTER (KIND=4)` string. The length of the string is then given in `opt_src_charlen` (also for string arrays).
  src_data | intent(in) A pointer the data to be send to the remote image. When a descriptor is provided in `opt_src_desc` then this parameter can be ignored by the library implementing the coarray functionality.
  opt_src_charlen | intent(in) When a char array is send, this parameter is set to its length.
  opt_src_desc | intent(in) When a descriptor array is send, then this parameter gives the handle.
  setter_index | intent(in) The index of the accessor to execute as returned by `_gfortran_caf_get_remote_function_index ()`.
  add_data | intent(inout) Additional data needed in the accessor. I.e., when an array reference uses a local variable v, it is transported in this structure and all references in the accessor are rewritten to access the member. The data in the structure of add_data may be changed by the accessor, but these changes are lost to the calling Fortran program.
  add_data_size | intent(in) The size of the add_data structure.
  stat | intent(out) When non-`NULL` give the result of the operation, i.e., zero on success and non-zero on error. When `NULL` and an error occurs, then an error message is printed and the program is terminated.
  team | intent(in) The opaque team handle as returned by `FORM TEAM`.
  team_number | intent(in) The number of the team this access is to be part of.

Notes:

  It is permitted to have `image_index` equal the current image; the memory to send the data to and the memory to read for the data may (partially) overlap. The implementation has to take care that it handles this case, e.g. using `memmove` which handles (partially) overlapping memory.