Fortran

Guide To Learn

The first step to any work with events is to post them using the event post statement, which takes the general form

event post(event_var[, stat, errmsg])

where event_var is a variable of event_type, and stat and errmsg have the same meaning as they do in the form team and change team statements.

While not strictly required by the language, you’d always want to post to an event variable on another image by coindexing it (indexing a coarray); for example

type(event_type) :: notification[*]
event post(notification[this_image() + 1])     ❶

❶ Posts a notification to the next image

You can post to an event variable as many times and as frequently as you want, with or without matching event wait statements. Every time you do, an internal event count for that event variable is incremented. You can also post to an event from more than one image. You’ll see soon how this mechanism can be used to make multiple event posts and wait for them only on some occasions.

Posting an event

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top