Waits until a specified counter reaches the value specified.
Availability Library (liblapi_r.a)
#include <lapi.h>
int LAPI_Waitcntr(hndl, cntr, val, cur_cntr_val)
lapi_handle_t hndl;
lapi_cntr_t *cntr;
int val;
int *cur_cntr_val;
include 'lapif.h'
LAPI_WAITCNTR(hndl, cntr, val, cur_cntr_val, ierror)
INTEGER hndl
TYPE (LAPI_CNTR_T) :: cntr
INTEGER val
INTEGER cur_cntr_val
INTEGER ierror
Type of call: local progress monitor (blocking)
This subroutine waits until cntr reaches or exceeds the specified val. Once cntr reaches val, cntr is decremented by the value of val. In this case, "decremented" is used (as opposed to "set to zero") because cntr could have contained a value that was greater than the specified val when the call was made. This call may or may not check for message arrivals over the LAPI context hndl. The cur_cntr_val variable is set to the current counter value.
LAPI statistics are not reported for shared memory communication and data transfer, or for messages that a task sends to itself.
{
int val;
int cur_cntr_val;
lapi_cntr_t some_cntr;
.
.
.
LAPI_Waitcntr(hndl, &some_cntr, val, &cur_cntr_val);
/* Upon return, some_cntr has reached val */
}