ARGOBOTS
1.1
|
This group is for Barrier. More...
Typedefs | |
typedef struct ABT_barrier_opaque * | ABT_barrier |
Barrier handle type. More... | |
Functions | |
int | ABT_barrier_create (uint32_t num_waiters, ABT_barrier *newbarrier) |
Create a new barrier. More... | |
int | ABT_barrier_reinit (ABT_barrier barrier, uint32_t num_waiters) |
Reinitialize a barrier with a new number of waiters. More... | |
int | ABT_barrier_free (ABT_barrier *barrier) |
Free a barrier. More... | |
int | ABT_barrier_wait (ABT_barrier barrier) |
Wait on a barrier. More... | |
int | ABT_barrier_get_num_waiters (ABT_barrier barrier, uint32_t *num_waiters) |
Get the number of waiters of a barrier. More... | |
This group is for Barrier.
typedef struct ABT_barrier_opaque* ABT_barrier |
int ABT_barrier_create | ( | uint32_t | num_waiters, |
ABT_barrier * | newbarrier | ||
) |
Create a new barrier.
ABT_barrier_create()
creates a new barrier and returns its handle through newbarrier
. num_waiters
specifies the number of waiters that must call ABT_barrier_wait()
before any of the waiters successfully return from the call. num_waiters
must be greater than zero.
newbarrier
must be freed by ABT_barrier_free()
after its use.
num_waiters
.ABT_ERR_INV_ARG
if num_waiters
is zero. num_waiters
is 0 cannot define a wait operation and should be prohibited. Note that even Argobots 1.0 does not allow ABT_barrier_wait()
with a barrier whose num_waiters
is 0. newbarrier
is set to ABT_BARRIER_NULL
if an error occurs.newbarrier
is not updated if an error occurs. newbarrier
when an error occurs. ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_ARG
is returned if num_waiters
is zero.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.newbarrier
is NULL
, the results are undefined.[in] | num_waiters | number of waiters |
[out] | newbarrier | barrier handle |
int ABT_barrier_free | ( | ABT_barrier * | barrier | ) |
Free a barrier.
ABT_barrier_free()
deallocates the resource used for the barrier barrier
and sets barrier
to ABT_BARRIER_NULL
.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_BARRIER
is returned if barrier
points to ABT_BARRIER_NULL
.barrier
is NULL
, the results are undefined.barrier
, the results are undefined.barrier
is accessed after calling this routine, the results are undefined.[in,out] | barrier | barrier handle |
int ABT_barrier_get_num_waiters | ( | ABT_barrier | barrier, |
uint32_t * | num_waiters | ||
) |
Get the number of waiters of a barrier.
ABT_barrier_get_num_waiters()
returns the number of waiters of the barrier barrier
through num_waiters
. The number of waiters is set by ABT_barrier_create()
and can be updated by ABT_barrier_reinit()
.
ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_BARRIER
is returned if barrier
is ABT_BARRIER_NULL
.num_waiters
is NULL
, the results are undefined.[in] | barrier | handle to the barrier |
[out] | num_waiters | number of waiters |
int ABT_barrier_reinit | ( | ABT_barrier | barrier, |
uint32_t | num_waiters | ||
) |
Reinitialize a barrier with a new number of waiters.
ABT_barrier_reinit()
reinitializes the barrier barrier
with the new number of waiters num_waiters
. num_waiters
must be greater than zero.
num_waiters
.ABT_ERR_INV_ARG
if num_waiters
is zero. num_waiters
is 0 cannot define a wait operation and should be prohibited. Note that even Argobots 1.0 does not allow ABT_barrier_wait()
with a barrier whose num_waiters
is 0. ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_ARG
is returned if num_waiters
is zero.ABT_ERR_INV_BARRIER
is returned if barrier
is ABT_BARRIER_NULL
.ABT_ERR_MEM
is returned if memory allocation fails.ABT_ERR_SYS
is returned if an error related to system calls and standard libraries occurs.barrier
, the results are undefined.barrier
is accessed concurrently, the results are undefined.[in] | barrier | barrier handle |
[in] | num_waiters | number of waiters |
int ABT_barrier_wait | ( | ABT_barrier | barrier | ) |
Wait on a barrier.
The caller of ABT_barrier_wait()
waits on the barrier barrier
. The caller suspends until as many waiters as the number of waiters specified by ABT_barrier_create()
or ABT_barrier_reinit()
reach barrier
.
ABT_ERR_BARRIER
is returned.barrier
. Otherwise, this routine does not switch the context of the calling ULT unless any user-defined function that is involved in this routine switch the context of the calling ULT.barrier
. Otherwise, this routine does not switch the context of the calling ULT unless any user-defined function that is involved in this routine switch the context of the calling ULT.ABT_SUCCESS
is returned if this routine succeeds.ABT_ERR_INV_BARRIER
is returned if barrier
is ABT_BARRIER_NULL
.ABT_ERR_BARRIER
is returned if the caller is a tasklet.[in] | barrier | barrier handle |