Fortran Wiki
event_query

Description

event_query assignes the number of events to count which have been posted to the event variable and not yet been removed by calling event wait. When stat is present and the invocation was successful, it is assigned the value 0. If it is present and the invocation has failed, it is assigned a positive value and count is assigned the value −1-1.

Standard

Class

Syntax

Arguments

count - (intent(out))Scalar integer with at least the precision of default integer.

stat - (optional) Scalar default-kind integer variable.

Example

program atomicuseiso_fortran_envimplicitnonetype(event_type)::event_value_has_been_set[*]integer::cntif(this_image()==1)thencallevent_query(event_value_has_been_set,cnt)if(cnt>0)write(*,*)"Value has been set"elseif(this_image()==2)theneventpost(event_value_has_been_set[1])endifendprogram atomic