W3cubDocs

/GNU Fortran 7

8.2.20 _gfortran_caf_event_wait — Wait that an event occurred

Description:

Wait until the event count has reached at least the specified until_count; if so, atomically decrement the event variable by this amount and return.

Syntax:

void _gfortran_caf_event_wait (caf_token_t token, size_t index, int until_count, int *stat, char *errmsg, int errmsg_len)

Arguments:
token intent(in) An opaque pointer identifying the coarray.
index intent(in) Array index; first array index is 0. For scalars, it is always 0.
until_count intent(in) The number of events which have to be available before the function returns.
stat intent(out) Stores the STAT=; may be NULL.
errmsg intent(out) When an error occurs, this will be set to an error message; may be NULL.
errmsg_len intent(in) the buffer size of errmsg
NOTES

This function only operates on a local coarray. It acts like a loop checking atomically the value of the event variable, breaking if the value is greater or equal the requested number of counts. Before the function returns, the event variable has to be decremented by the requested until_count value. A possible implementation would be a busy loop for a certain number of spins (possibly depending on the number of threads relative to the number of available cores) followed by another waiting strategy such as a sleeping wait (possibly with an increasing number of sleep time) or, if possible, a futex wait.

The statement is an image-control statement but does not imply sync memory. Still, all preceeding push communications of this image to the specified remote image have to be completed before event_wait on the remote image returns.

Next: , Previous: , Up: Function ABI Documentation [Contents][Index]

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gfortran/_005fgfortran_005fcaf_005fevent_005fwait.html